Thanks! Will update with visual-theremin code if/when I get it to work. though I was able to get a busy-loop with a delay to effectively dim an LED. So does this mean that USB_VCP is useless for the F401? It seems LED.intensity is also broken or not implemented. The USB connector available is for the STLink and the VCP com port created forward the data of a real USART. Thanks, I figured as much, having some prior experience with microcontrollers and JTAG. The Nucleo F411RE has no real USB connector. You'll need to connect Tx from the USB-serial adapter to Rx on the F401, Rx on the USB serial adpater to Tx on the F401, and GND from the USB-serial adapter to GND on the F401. If you're going to use UART-6 then you need to connect a USB-to-serial adapter to the appropriate pins on the board and also use the appropriate /dev/ttyACMx for the usb-to-serial adapter. Note: If you're going to use UART-2 then you need to quit whatever program you were using for the REPL before running your host program. now back to co-routine mutlitasking for a GPIO cap-sense to LED-brightness visual-theremin! I changed the device program back to UART 2, and prepended a 'print' on the client-side and voila! Its possible use the USB connector present on the STM32 NUCLEO board. You also don't print anything in your host program - you just read the data over and over in an infinite loop.ĭ'OH! That was the key here. I suggest to use on the PC a terminal emulator like TeraTerm, configured has show below. Yeah I was trying all sorts of things, with ser.read() and sending different strings from the MCU side. Now your host program calls readline, which waits for a newline, and since you don't send any, it will wait forever. Strangely it seems like pyb either carries over from boot.py, or it just magically is there, as I find pyb calls to work from the non-boot.py scripts that boot.py calls. I also uncommented he import of pyb which you'll need since you call pyb.delay: That's why I tried both USB_VCP, thinking well, I guess maybe that sends JTAG-encapsulated commands when you call write on it, while the UART would have its RS232-style protocol wrapping the data. Yeah that is what I figured when I was going through the schematic from STM, and also suspected it from eyeing the traces on the board for PA2 and PA3 (they looked unconnected, as in the schematic, and by default being routed to the ST-LINK TDI and TDO pins) Here is a screenshot of the flags I selected. My sketch uses multiple serials because I need to use the usb serial monitor while also communicating to another device on a different serial port. It would be useful to describe what you're connecting to where.īy default, UART-2 is connected to he stlink processor, which will be advertised as /dev/ttyACM0 when plugging in the NUCLEO board I just received a Nucleo F401RE and cant get my sketch to work on it because the compiler says Serial1 is not defined.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |