Trying to create an app to control LED on SC20100 Dev Board

Hi,

Im trying to create an windows app that will control an LED on board the SC20100 Dev Baord, ive tried this tutorial
https://docs.ghielectronics.com/software/tinyclr/tutorials/usb-cdc-winusb.html, and once i upload the code, it works when i test with terrterm but then i cannot debug anymore or put new code up.

can someone explain the difference between USB, VCOM COM5 and how am i suppose to write/debug/test my app?

could you also create a small sample to achieve that?

What interface are you using to make DEBUG connection? If you want to use usb-cdc you have to debug over serial as the USB port will not be available after you change it with the code.

Did you do this… Quoting the docs

“Note that the debug interface needs to be switched to serial (UART) to free up the USB Client port”. Which board are you using?

How do i do that? i tried holding the MODE button and then reseting but i cant connect to the board when i try selecting serial transport in VS
SC20100 Dev Board Rev A

I managed to do this, so this sort of works

the serialport.Write(“1”) and whats recieved have nothing to do, its just a count as per the default tutorial

1 Like

Awesome. Let us know if you need any further help.

As I asked, how do I now change code and upload again, to the dev board. Only thing that works is LDR0->RESET connect with config tool and erase all, and start the process all over again. Surely thats not how its done

What is the use for VCOM COM5? and why isnt serial debugging working for me?

Do I need RS232 to debug and deploy via serial?

You have 2 USB ports, one is connected to a serial port (virtual com) that you can use to deploy and debug. This port works when you hold mod pin down.

You must hold it down with every reset/deploy or add a wire from it to ground

What revision do you see on the board?

On SC20100D there is no “VCOM COM5”, isn’t RevC?

Doesn’t work for me, i press and hold the MODE then press RESET and let RESET go. It still just only shows COM4, which i cannot connect to with either Config or VS.

I have the RevA version

if SC20100D then you have to find COM1 (UART1) to connect to PC.
Latest firmware we switched from COM5 (UART5) to COM1 (UART1) on SC20100D.

I believe on your board it is PA9 (TX) and PA10 (RX) on left-bottom of biggest IO header.

It still just only shows COM4

And COM5 on your board is not COM5 on PC. They are different.

If you are using RevC then no need RS232, if RevA or B you need it if want to debug by serial uart.

If you just want to download the application, then follow these steps:

  • Hold the APP button, hit Reset button, wait a bit, then release the APP button => This will prevent your application runs.
  • Deploy by USB as normal.
  • Hold the MOD button.
  • Hit reset again

The board will boot and run your app in serial debugger mode.

Ok, this sort of works, i don’t want the serial debugging anyway.
When i stop the app, i can upload a new one. Then it switches back to CDC to configure via PC.

Thanks

1 Like

What does this mean:

* Changed serial deploy/debug port from UART5 to UART1 on 100 pin devices. SC20260B still uses UART5.

in the context of creating my own board? im going to use SCM20100E do i need to also connect FT232RL to UART1 in order for serial deploy/debug to work? currently im designing it for UART2

Do you need serial debugging? In your production board?

if you’re designing your board to use UART2, then a change from UART5 to UART1 for a system function will have no impact. But whether you need serial debug on your production board, as Gus asks, is only a question you can answer - but seems likely that the answer is no, you just need a serial port for your own use within the app…

I intend to use USB CDC to connect the device with my windows app, so when i develop this i will need serial debugging?

when i set this up:

var usbclient = GHIElectronics.TinyCLR.Devices.UsbClient.UsbClientController.GetDefault();

this uses USB CLIENT (USBC N, USBC P) for use as USB CDC, correct?
so if i want debugging and deployment i need to use serial debugging in VS and connect to UART1?

Yes you are correct, you need serial debugging. So, what is the question?