cancel
Showing results for 
Search instead for 
Did you mean: 

I-CUBE-LRWAN v2.0.0 with Nucleo-L073RZ board and I-Nucleo-LRWAN1 shield

Andrew Neil
Evangelist III

Nucleo-L073RZ board and I-Nucleo-LRWAN1 (USI module) shield - as supplied as the "Sensor" part of the P-NUCLEO-LRWAN2 kit:

0693W00000Bca5WQAR.png 

The documentation refers to I-CUBE-LRWAN at v1.2.2; in v2.0.0 (March 2021), the directory structure has changed somewhat.

I assume the correct path for the "Sensor" node project is now:

Projects\NUCLEO-L073RZ\Applications\LoRaWAN\LoRaWAN_AT_Master\STM32CubeIDE\I_NUCLEO_LRWAN1

Can anyone confirm if this actually works?

At the moment, mine doesn't seem to be sending any AT commands from the Nucleo board to the USI shield...

43 REPLIES 43

'Did you check with "__HAL_RCC_GPIOA_CLK_DISABLE()" and "__HAL_RCC_GPIOC_CLK_DISABLE()" in comment'

Not yet ...

'Try to either spy PA2 or spy PA3 but not both in the same time'

Why not? What difference would that make? You really do need to be able to see both sides of the conversation!

'To solve the hard fault (I do have to check completely why) do disable the debug mode ( in sys_app.c the DBG_Init() function). In addition in the Gpio_PreInit() function put in comment the two "__HAL_RCC_GPIOA_CLK_DISABLE()" and "__HAL_RCC_GPIOC_CLK_DISABLE() " statement.'

If I do that, I still get no AT Command transmitted and, because the debug connection is now disabled, I cannot see what is happening - whether it's Hard Faulting or not!

(I am spying on only the L072 Transmit - as I can do that with just the ST-Link without also having to get out any FTDI cables).

ADDENDUM

So we're here:

0693W00000BdaYzQAJ.png 

Disabling these lines in Gpio_PreInit():

0693W00000BdaZJQAZ.png 

I've disabled Debug:

0693W00000BdaZTQAZ.png 

But the CubeIDE highlighting doesn't recognise it:

0693W00000BdaZdQAJ.pngAlthough stepping in the debugger does show that it executes the greyed-out code!

How do I re-sync the highlighting in the CubeIDE? Closing & re-opening didn't help.

EDIT

Found it:

0693W00000BdabAQAR.png

JCOUP
Associate III

Andrew , Ok can you just put in #if 0 DBG_Init() #endif . Just to avoid to spepping in the debugger code.

The code is building correctly - it is doing the "DEBUGGER OFF" part - it's just the IDE that was incorrectly shading the source in the editor.

This was fixed by doing the Index > Rebuild:

0693W00000CzgwqQAB.png

If I comment-out the call to DBG_Init():

/**
  * @brief initialises the system (dbg pins, trace, mbmux, systiemr, LPM, ...)
  * @param none
  * @retval  none
  */
void SystemApp_Init(void)
{
  /* USER CODE BEGIN SystemApp_Init_1 */
 
  /* USER CODE END SystemApp_Init_1 */
 
  /*Initialises timer and RTC*/
  UTIL_TIMER_Init();
 
  Gpio_PreInit();
 
  /* Configure the debug mode*/
  //DBG_Init();	                   	### disabled per @JCOUP
 
  /*Initialize the terminal */
  /*UTIL_ADV_TRACE_Init();*/
 
  /*Set verbose LEVEL*/
  /*UTIL_ADV_TRACE_SetVerboseLevel(VERBOSE_LEVEL);*/
  /*Initialize the temperature and Battery measurement services */
  SYS_InitMeasurement();

Then I do se one AT Command sent:

0693W00000CzjMgQAJ.png 

But then nothing more happens.

If I halt the debugger, it's in the Default_Handler again - another Hard Fault ?

0693W00000CzjKbQAJ.png 

Maybe it's not actually a Hard Fault - some other unhandled interrupt ... ?

rYurd.1
Associate III

Hi JCoup,

I have very fundamental question for you.. in fact to STM.. if you have a look , you iwll see that we all claiming same issue.. ( like : https://community.st.com/s/question/0D53W00000rauT3SAI/cant-make-at-master-application-to-work-on-nucleolrwan1nucleol073rz-pair)

1) we all purchased the same STM product (P-NUCLEO-LRWAN2 )

2) we all downloaded same code from STM web side (-CUBE-LRWAN Expansion Package)

3) we all tried same debugging as mentioned at STM web side

4) finally we all cliaming that "we dont see any transmission between 2 boards ( NUCLEO-LRWAN1 and NUCLEO-L073RZ )

So, instead of asking .. isnt it possible for you to create the problem on your side? and let us know "what was the problem?"

thanks, reha

JCOUP
Associate III

Hi, yes you have exactly the same problem that Andrew. No communication between master and Modem. I have reproduced the problem on my side. I expect to propose to the community a fix soon ( beginning of next week).

rYurd.1
Associate III

Hi JCoup

excellent news and thank you so much for your support. reha

JCOUP
Associate III

oK , we see the TX (ATE is a md to disable echo). Normally after we must have the AT cmd to see is the modem is ready and then the AT+JOIN=1. Should seem that problem come just afetr ( yes could be unexpected interrupt ???). Could to could plug the spy on the RX ( modem to master transmission) to see the return value coming from Modem. Is it possible for you to to step by step up to the Lora_fsm() (line 99 - app_master.c file)

JCOUP
Associate III

Andrew, Here are some fixes to solve the problem . Main problem encountered was du to a less memory array allocation. Was already present in the previous version of the package (1.3.1) but without board effect !!! (could be possible following the final mapping organization provided by the linked).

in lora_driver.c in line 81 --> replace 16 by 32 size --> static uint8_t PtrTempValueFromDevice[32] ; /*to get back the device address in */

in sys_app.c --> just reorganize two statements UTIL_TIMER_Init() and Modem_IO_Init() in the SystemApp_Init(void) function

 */

void SystemApp_Init(void)

{

 /* USER CODE BEGIN SystemApp_Init_1 */

 /* USER CODE END SystemApp_Init_1 */

 /*Initialises timer and RTC*/

 /*UTIL_TIMER_Init();*/

 Gpio_PreInit();

 /* Configure the debug mode*/

#if 1  

 DBG_Init();

#endif

 /*Initialize the terminal */

 /*UTIL_ADV_TRACE_Init();*/

  

 Modem_IO_Init();

  

  /*Initialises timer and RTC*/

 UTIL_TIMER_Init();

 /*Set verbose LEVEL*/

 /*UTIL_ADV_TRACE_SetVerboseLevel(VERBOSE_LEVEL);*/

 /*Initialize the temperature and Battery measurement services */

 SYS_InitMeasurement();

 /*Initialize the Sensors */

 EnvSensors_Init();

 /*Init low power manager*/

 UTIL_LPM_Init();

 /* Disable Stand-by mode */

 UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE);

#if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1)

 /* Disable Stop Mode */

 UTIL_LPM_SetStopMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE);

#elif !defined (LOW_POWER_DISABLE)

#error LOW_POWER_DISABLE not defined

#endif /* LOW_POWER_DISABLE */

 /* USER CODE BEGIN SystemApp_Init_2 */

 /* USER CODE END SystemApp_Init_2 */

}

in sys_app.c --> remove from MasterApp_Init(void) the Modem_IO_Init()

in sys_app.c --> remove Gpio_PreInit(void) the two follwoing statements

line 310 --> /* __HAL_RCC_GPIOA_CLK_DISABLE();*/

line 312 --?  /* __HAL_RCC_GPIOC_CLK_DISABLE();*/

in uart.c --> add the sys_conf.h --> to define the USE_USART2 symbol

here is the trace ( Rx pin) transmitted by the modem at reset .. Then after join accepted modem return 254 for battery level and return code OK for the sending frame . On Tx we see the AT+SEND cmd

This problem will be reported on L073 and L053 and will be present in the future next package release ...