cancel
Showing results for 
Search instead for 
Did you mean: 

LED1/2/3 working on arduino but not on CUBEMX

BNamu.1
Associate II

Hello, i just bought a STM32WL55JC2. It's working perfectly on Arduino but i want to use the LORA module and Arduino doesn't support it.

I've configured my stm on CubeMX and tried a basic HAL_GPIO_WritePin but it doesn't work and i can't figure why.

0693W00000WIFX9QAP.jpg0693W00000WIFXiQAP.jpgArduino working code :0693W00000WIFROQA5.jpg0693W00000WIFXdQAP.jpgThank you :)

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief III

check: did you

0693W00000WIIGBQA5.png 

x set free pins as analog ?

+

to test : just write

GPIOB->MODER = 0x55555555 ;

while ....set pin .... .

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

14 REPLIES 14
AScha.3
Chief III

why only download ?

try : debug and you can see the port registers , when you step in your prog.

If you feel a post has answered your question, please click "Accept as Solution".
BNamu.1
Associate II

0693W00000WIHF7QAP.jpg@AScha.3​ I can't figure which register is attached to my LEDs ? Thank you

edit : r1 and r2 have changed for 512 after 1 while loop

The registers in the GPIOB peripheral, ie GPIO->ODR

And the clocking of the GPIOB via the RCC peripheral

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you, where do i check the GPIO->ODR state in the debug mode ?

In Keil I'd open a Peripheral View

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

0693W00000WIHf0QAH.jpgthere is a problem with the BSRR right ?

i tried to change manually the register ODR but it still doesn't work

No idea what board you're using or if the LEDs illuminate when LOW rather than HIGH.

BSRR is supposed to be a write-only means of changing ODR, ie single action rather than RMW at a software level.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
AScha.3
Chief III

BSRR is write only. so nothing to read!

and ODR shows ffff , what you write in. so whats wrong ??

If you feel a post has answered your question, please click "Accept as Solution".
BNamu.1
Associate II

if my gpiob->ODR shows ffff the led on my board should be turned on right ?