I have stm32l100 and stm32l152 disco boards and am using stm32cubemx and sw4stm32 IDE.
After creating default project for them in cubemx - I mean I go through board chooser and then leave everything as is except changing library from HAL to LL in project -> settings -> advanced settings for both RCC and GPIO and generate project for sw4stm32 - I import it to sw4stm32, add some code for LED3 blinking (to while loop in main function):
LL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin); LL_mDelay(1000);
build it and run it (it's written to board, I see status LED blinking), but LED3 does not blink.
When I run it in debug mode and step the code it fails at line (in SystemClock_Config() function):
LL_FLASH_GetLatency() != LL_FLASH_LATENCY_1
and goes to Error_Handler() which sits in while loop forever...
This happens on both boards and when I flash them with LED blinking ST's example it works, so it should be some firmware problem and I would say some initialization problem. I read STM32CubeL1GettingStarted.pdf and there is written that I should define right macro in stm32l1xx.h - which should be STM32L100xC or STM32L152xC and I did it - or rather uncomented existing one in that file. I even tried to add it to main.c file - it didn't help. And I tried to do it with and without this macro defined.
The only close question I found is this https://community.st.com/thread/15501 - but in v 1.8.0 of cubemx library this seems to be in right place.
I'm quite noob to these boards and have experience only with arduino so all this setup is quite overhelming for me right now and don't know where the cause could lie... so if anybody could direct me I would apreciate it really much.
UPDATE: I even tried to generate project with older version of LL libraries (1.7.0 and 1.6.0), but still no progress.
Does anybody at least have some tutorial for blinking leds (or manipulating with GPIO) on L1 processors using LL library based on cubemx generated project?
Or could somebody send me working led blinking (gpio manipulating) code for STM32L100RC or STM32L152RC generated in cubemx using LL library? Thanks.
UPDATE2: Now I tried to do exactly the same steps using HAL library and it works (previously I used ST's cubemx blinking example), so it looks like a bug? I had some problems registering at ST's site so I wrote here first, but now it works, so I'm writing also there - will add link.
UPDATE3: link to my question on ST forum: https://community.st.com/message/177130
UPDATE4: so here is the code, if somebody wants to look at it, but as I said it's basic projecte generated in cubemx with added pin toggling: https://drive.google.com/open?id=1cMD3MVGXOofLq63syTW1itVMJL3xaIMh