5 years, 3 months ago.

Support for Nucleo-L152RE?

This doesn't work for the L152RE board. Is there no support of the L152RE? It's not included among the targets in the configuration files located in rtx/TARGET_CORTEX_M folder. When I add initialisations of system variable for for L152RE, I can get it to compile, but it looks like threads are not created and the program just hangs.

Does this example program work? Has anyone at ST tested it? If I were to buy one of the boards listed in the config files, would it work then?

I see that many others have had similar issues. But still no solution? Is there a reason? I don't understand why the L152RE board was not included among the targets.

Thanks, John

Question relating to:

RTOS example Nucleo, rtos, STM, stm32

2 Answers

5 years, 3 months ago.

Current mbed-rtos (Revision 76) does not support L152RE mbed.
If you change two files, you can use rtos with Nucleo L152RE mbed.
1) /mbed-rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c
2)/mbed-rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h
Followings are my modified revision.
/media/uploads/kenjiArai/l152_rtos_rtx_conf_cm.c
/media/uploads/kenjiArai/l152_rtos_rtx_cm_lib.h
Rename it and change with original two files.

By the way, rtos supports STM32L053R8/C8 mbed, F072, F091RC and other STM32 series.
Just forgot L152!!

Kenji, I tried your suggestion already and my files look essentially like yours. I did update my files to yours just in case, but the example "Nucleo_rtos" does not run. It compiles, but when I run it, it freezes.

The problem is Thread - when I remove the threading, I can alternately flash the LED and print out statements. Just as a sanity check.

Do you have a simple Threading example that you have successfully run on the L152RE?

I believe the "main" thread runs fine, but no other threads are created. The program blocks when an attempt is made to create a different thread.

Thanks, John

posted by John Sainsbury 12 May 2015

Hi John,

I have locally tested the code from Arai-san and worked fine.

mbed RTOS example
During the last 6 seconds, the Button was pressed 5 times
During the last 6 seconds, the Button was pressed 1 times
During the last 6 seconds, the Button was pressed 7 times
During the last 6 seconds, the Button was pressed 41 times


Then, I made a pull request for this change.

https://github.com/mbedmicro/mbed/pull/1106

posted by Toyomasa Watarai 14 May 2015

Watarai-san,
Thank you for your big support!

John,
I will make a simple sample program this weekend.
Please wait.

posted by Kenji Arai 14 May 2015

Hi John,
As I mentioned above, I made a sample program.
/users/kenjiArai/code/Nucleo_rtos_sample/rev/587b8f1bab9d
Before using the program, please read following my note and modify the program if you want.
/users/kenjiArai/notebook/necleo-l152re-rtos-sample-also-for-f401re--f411re-/
Sample program shows several example like;
osThreadDef
osThreadCreate
Thread::wait
Thread::yield
mail_box
Mutex
osDelay
void mbed_die(void)

Watarai-san,
Thanks again for pull request action and rev. 77 was released with based on the request.
Unfortunately, I don't inform you the System Clock issue before official release.
I have recognize it yesterday using logic analizer.
I hope mbed team will update remained parts ASAP.

posted by Kenji Arai 16 May 2015

Hi Kenji, Thank you for taking the time on this issue and writing such a thorough answer. I've tried again and it seems to work with online compilation, which is really great, but when exported to gcc (arm embedded), the same program compiles but freezes when run on the L152 board. I was originally working with it off line and I have been having problems with the exports lately. Could this be another issue? I have found (as others have) that the exports are often corrupted.

posted by John Sainsbury 17 May 2015
5 years, 2 months ago.

Arai-san,

Thank you very much for your investigation. You can make a pull request to the mbed GitHub repository.

https://github.com/mbedmicro/mbed

The mbed-rtos code is available here: https://github.com/mbedmicro/mbed/tree/master/libraries/rtos

Hi Toyomasa,

I have tried updating all the mbed libraries, so I have the very latest. Then I replace the modified files from Kenji. But still the Nucleo_rtos code does not work properly. The first printf statement runs and outputs "mbed RTOS example", but nothing else happens.

Thanks anyway for your suggestions.

Can anyone from ST shed some light no this?

Thanks, John

posted by John Sainsbury 13 May 2015