Page 2 of 3

Re: STM32L0 - Cortex M0+ Support

Posted: Wed May 20, 2015 11:41 pm
by cruz_91
Few days ago I purchased nucleo with STM32L053. This mcu is other than well knowns mcus like L1 or F0 (eg. GPIO bus compared to L152). I also saw that chibios not support this mcu and I need to run chibios on this board (yap, I want to test my MSc project on cortex M0+). Today I spend few hours to start it. For now mcu with gpio subsystem is initialized. System functions like chTdhSleep doesn't work.

Next plan?
-> Prepare fully works chibios
-> Prepare fully works uart (for communication ofc)

Source code is available in my repository:
https://github.com/cruz91/ChibiOS/tree/ ... 53-support

//Edit
Few minor changes in timers isrs provide to work chibios functions. Now code from testhal (UART) can blink led.

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 8:01 am
by Giovanni
Hi,

Good to know you are going ahead, official support for L0 (and L4, f7) will happen after the final 3.0 release.

Giovanni

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 9:40 am
by cruz_91
Hi,

The most important thing to do now is to run UART to communicate with µC. DMA with UART seems to work good, but doesn't send characters.
The second problem is how to implement and manage low power peripherials. Currently I only see it on schemes and I must to read more in reference manual. It looks like other domain of PLL and can (but musn't) be hard to implement. We will see.
I'll prepare some code to work with nucleo L053, maybe it can be used in chibios 3.0 :)

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 10:11 am
by Giovanni
DMA is different on L0, this will require an updated driver because there is a peripheral selector register added. This is the reason for moving it after 3.0.

Giovanni

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 11:07 am
by cruz_91
Hi,
Do you think about DMA_CSELR register?
F09x also has this register.

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 11:17 am
by Giovanni
Yes, that one. F09x is not yet supported too.

Giovanni

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 11:34 am
by cruz_91
Ok, but it is possible to run example apps without big changes in DMA support. Only for tests and initially support new platform

Re: STM32L0 - Cortex M0+ Support

Posted: Thu May 21, 2015 10:40 pm
by cruz_91
Hi,
Giovanni, thanks for tip about CSELR register. I modified dma driver for L0 and add simple workaroud. I choose some the most important peripherials (in my opinion) and connect them to free channels. Currently Chibios UART testhal works perfectly with nucleo board :) Just connect, program and open nucleo serial port.

STM32L0 is very castrated device... only two priority bits (0,1,2,3), strange DMA...
But I've got idea for now to move connection between channel and peripherial in CSELR register to mcuconf. I can prepare some defines to check settings. But it is idea for now...

Karol

Re: STM32L0 - Cortex M0+ Support

Posted: Thu Jul 16, 2015 11:17 am
by Giovanni
Update, I have most of the code done but I am unable to use OpenOCD, it connects but then it reads the flash as all zeroes. Flashing does not work too.

Using the ST-Link utility works but I can't debug so I am stuck.

I will try using keil/iar...

Giovanni

Re: STM32L0 - Cortex M0+ Support

Posted: Thu Jul 16, 2015 12:39 pm
by Giovanni
Apparently is the latest OOCD 0.9.0 that has problems, I returned to the old 0.9.0dev version and it works (the one included in ChibiStudio).

The STM32L0xx now works, I just tested ST, PAL and Serial drivers, other drivers will require more work because it has a new DMA infrastructure (way more flexible).

Giovanni