2016-09-21 01:37 AM
Hi there,
I was just struggling to get a really simple bare metal project working for the L476 Discovery board. It would just not work in TrueStudio, where the startup would hang on this line: if (HAL_UART_Init(&huart2) != HAL_OK)As far as I can tell, the huart->gState is not being read correctly; it is reported as a value of 5 (decimal), which the comments for the typedef enum seem to indicate should not be possible.However, if I regenerate the project for IAR, load, build, and debug, it seems to get past that line with no problem. I haven't done the printf redirection to USART2 yet (don't know how to, actually, feel free to sound off on that too), so I haven't verified if the peripheral is actually working or not. But at least execution gets through to the main loop.So ... bug? Pretty weird. It would be great if TrueStudio worked since I like that IDE and I really don't want to have to buy IAR :\2016-09-21 06:41 AM
Hi pullin.andrew,
Which version of STM32cubeMx are you using ? you should share with us your .ioc file. -Hannibal-2016-09-21 08:00 PM
I am using version 4.1 of STM32CubeMX and version 1.5.1 of the STM32L4 libraries.
ioc file is attached. ________________ Attachments : stm32l476_test_proj.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtgY&d=%2Fa%2F0X0000000aVj%2FZcWyHCn22bc71pODY47I2rqDVcKlavyEe3yVnIXRuLA&asPdf=false2016-09-22 10:46 AM
Just as another quick follow-up, I noticed that the linker warning was emitted:
''warning: memory region `RAM' not declared'' ,after seeing another post on the forum about how the linker script is not correctly set up for the separate RAM's.2016-09-22 09:11 PM
OK ... more progress.
By disabling all optimization in Atollic (-O0), the code now runs OK.All other optimization settings (-Os, -Og, -O1, -O2, -O3, -Ofast) all produce the same failure.2016-10-02 10:18 AM
I've run into a problem with CubeMX where the intended target is SW4STM32 (Not Atollic but both are GCC and Eclipse based). If at any point the project is generated for EWARM, and THEN generated for SW4STM32 it will generate happily but there will be issues when running. This may be related if you accidentally generated it for EWARM first (the default setting so it is very easy to do this) and then generated for the correct toolchain. I would try just deleting the entire project directory and do it over being careful to ONLY generate for Atollic.
Good Luck,Aaron