cancel
Showing results for 
Search instead for 
Did you mean: 

The simplest and most basic LL driver App doesn't work

WQ
Associate III

We tried the simplest and the most basic LL driver based App, LED blinking, on Nucleo boards:

int main(void)
{
 LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
 LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
 NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
 SystemClock_Config();
 MX_GPIO_Init();
 MX_USART2_UART_Init();
 while (1)
 {
 LL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
 LL_mDelay(1000);
 }
}

Comments and empty lines are removed. We just added two lines of code in the while loop. Everything else is from MX. (LED pin changes with different Nucleo boards).

Well, it doesn't work. It failed on Nucleo-L432KC and Nucleo-L452RE. Both are L4 MCU so they use the same FW and library. It can't pass through the system clock configuration. The MCO output of the internal PLL has no life at all.

However, it works on Nucleo-WB55RG. The LED is blinking!

Is there anything I missed in LL based programming? or is there anything to fix for L4 firmware and library?

Thanks. -wq

11 REPLIES 11

HSE can also be used with it. You just have to switch the HSE oscillator to bypass so that it can use the externally supplied 8 MHz.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
WQ
Associate III

Thanks Peter! it is good to know that external clock can be used to OSC_IN. The datasheet and RM didn't mention it. I was wondering for a while. Even I wanted to try STLINK's MCO clock, I had to solder a few SBs. So, I was lazy and moved to HSI. It worked but UART (STLINK's VCP) was scrambled. Then I switched to MSI (with LSE turned on according to the documents). UART worked. I would then be able to test DAC and ADC that didn't work well on NUCLEO-L432KC.

Long story short, DAC started to work when I switched to HAL (others are still LL). I still don't understand it. DAC is a simple peripheral and the LL driver was copied (referenced) from Example(s). I will look at it further. The ADC still didn't work well, the internal VREFINT/TS/VBAT channels are still interfered by analog channels when they are in multiple channels for continuous/scanning sampling.

It is same to L432KC, DAC started to work with HAL driver and ADC's internals are interfered by analog pin signal.

-wq