MicroPython on STM32L496RGT6 for a new board

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
nodemite
Posts: 2
Joined: Tue Feb 11, 2020 6:02 pm

MicroPython on STM32L496RGT6 for a new board

Post by nodemite » Tue Feb 11, 2020 6:05 pm

Hello to all
I would like to know if it is possible to port on this micro:
STM32L496RGTx with 1Mb of flash and 320Kb of RAM, uSD, USB, two 2 resonators for RTC and USB and other features.
Do you think it will be difficult to do the porting?
For the USB resonator do you recommend 12 or 24Mhz?
Thanks

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: MicroPython on STM32L496RGT6 for a new board

Post by jimmo » Tue Feb 11, 2020 10:19 pm

nodemite wrote:
Tue Feb 11, 2020 6:05 pm
Do you think it will be difficult to do the porting?
There's already a board definition for this chip. https://github.com/micropython/micropyt ... 2L496GDISC

Although that's not for the RGTx, you might need to make a custom linker script for your flash/ram size.

nodemite
Posts: 2
Joined: Tue Feb 11, 2020 6:02 pm

Re: MicroPython on STM32L496RGT6 for a new board

Post by nodemite » Fri Feb 14, 2020 9:15 pm

Hi jimmo
Thanks, I am currently developing a board with STM32L496RGx 1M flash/320K Ram, with uSD 4wire, SPI, UART, I2C etc, 2 crystals, one of which for USB.
Would it be useful to follow some tutorials to start from scratch? I mean to do the porting
Thanks

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: MicroPython on STM32L496RGT6 for a new board

Post by jimmo » Sat Feb 15, 2020 1:19 am

nodemite wrote:
Fri Feb 14, 2020 9:15 pm
Would it be useful to follow some tutorials to start from scratch? I mean to do the porting
Sorry there aren't any tutorials on this, but the basic idea is to start with a copy of the board directory that you're basing this on (i.e. ports/stm32/STM32L496DISC), and go through line by line of each of the four files (they're all pretty short) and update them to match your board.

It looks like you'll even be able to use the existing linker script (stm32l496xg.ld -- 1MiB flash / 320kiB ram), so really all you have to do is set the board name, clock params, and enable/disable any features.

Something like:

Code: Select all

cd ports/stm32
cp -r boards/STM32L496DISC boards/MYBOARD
edit boards/MYBOARD/mpconfigboard.h, mpconfigboard.mk, pins.csv, stm32l4xx_hal_conf.h
make BOARD=MYBOARD
make BOARD=MYBOARD deploy # this will use st-link

Post Reply