2021-07-01 07:10 AM
Nucleo-L073RZ board and I-Nucleo-LRWAN1 (USI module) shield - as supplied as the "Sensor" part of the P-NUCLEO-LRWAN2 kit:
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...
Solved! Go to Solution.
2021-07-13 08:19 AM
'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!
2021-07-13 10:29 AM
'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:
Disabling these lines in Gpio_PreInit():
I've disabled Debug:
But the CubeIDE highlighting doesn't recognise it:
Although 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:
2021-07-15 01:30 AM
Andrew , Ok can you just put in #if 0 DBG_Init() #endif . Just to avoid to spepping in the debugger code.
2021-07-15 04:11 AM
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:
2021-07-15 08:55 AM
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:
But then nothing more happens.
If I halt the debugger, it's in the Default_Handler again - another Hard Fault ?
Maybe it's not actually a Hard Fault - some other unhandled interrupt ... ?
2021-07-15 09:11 AM
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
2021-07-16 04:55 AM
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).
2021-07-16 04:59 AM
Hi JCoup
excellent news and thank you so much for your support. reha
2021-07-16 05:11 AM
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)
2021-07-21 07:30 AM
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 ...