cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WL55JC1 - LoRaWAN_End_Node (CubeWL latest version) : I can't use I2C in this sample code (STM32WL)

LLr.1
Senior

Hi,

I use an Nucleo-32WL55JC1 with one MS5637 (pressure sensor).

(The point is not the precise sensor but the I2C communication. )

In CubeMX, I designed the pins : 0693W00000GYFPwQAP.pngIn main.c, I added :

I2C_HandleTypeDef hi2c1;

And in the main function :

 BSP_LED_Init(LED3);

And in the error handler :

0693W00000GYFRYQA5.pngIn order to see errors without the debeugger.

Then, in lora_app.c,

#include "i2c.h"

at the begging of the SendTxData():

0693W00000GYFSbQAP.png 

The results :

0693W00000GYFUmQAP.pngThen, 5 seconds after, the RED LED blinks -> Thus, It's in Error_Handler

BUT

  1. if I comment this line : my_ret=HAL_I2C_Master_Transmit(&hi2c1, MS5637_ADDRESS_W, pMS5637_RESET, sizeof(pMS5637_RESET), 50); -> It's work well, I receive messages
  2. Instead of the action 1, if in sys_conf.h I put 1 to LOW_POWER_DISABLE and 1 also to DEBUGGER_ENABLED -> It's work well, I receive messages

Thus, I cannot see clearly the problem because each time with the debeugger it is ok but without it it's not !

Thank you for your help

0 REPLIES 0