STM32L462 Port

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
LoialOtter
Posts: 2
Joined: Fri Apr 06, 2018 12:42 am

STM32L462 Port

Post by LoialOtter » Fri Apr 06, 2018 1:02 am

A couple of us have ported micropython to the STM32L462 and overall it's working. We've hacked together a fix to allow micropython to work on CPUs with the non-OTG USB found on the smaller ST parts as well as this one.
https://github.com/oskirby/micropython

I'm having a bit of trouble with the CDC part and am looking for any help in case it's something obvious.

Right now opening up the interface in putty I receive what ever's in the buffer, so error messages and the output from the last command run, etc. Typing stuff in I get no echo back. On pressing enter micropython does run what ever I've typed though it's hard to know for sure as I don't get any text back. If I close off the shell and open a connection again I get what's in the buffer.

I don't quite follow how the CDC interface works - it looks like there's a UART being used under the hood and it's somehow copied into the USB interface; I'm guessing this isn't happening correctly.

Any help would be greatly appreciated

LoialOtter
Posts: 2
Joined: Fri Apr 06, 2018 12:42 am

Re: STM32L462 Port

Post by LoialOtter » Fri Apr 06, 2018 6:54 am

Found the issue... Around line 167 of usbd_cdc_interface.c we wrote the check if the TX buffer is in use incorrectly. Commenting that section out makes things work but I bet it's not ideal.

I'm guessing experience with the USB (non-OTG) peripheral is lacking here as it's not supported yet, but if anyone has any suggestions on how to implement that check, let me know. Thanks.

Post Reply