Skip to main content
pbdiazam
Associate II
Aug 6, 2018 12:05 PM UTC
Solved

PingPong example from I-CUBE-LRWAN software not working on B-L072Z-LRWAN1

As I said in the title, I tried to test the PingPong example avaliable in the I-CUBE-LRWAN software expansion but it does not work on B-L072Z-LRWAN1 board.

After importing the project to SW4STM32 and running it (without doing any modifications), this is what I get in console:

Open On-Chip Debugger 0.10.0-dev-00010-g96aab7b (2018-07-13-06:51)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 240 kHz

adapter_nsrst_delay: 100

Info : clock speed 1800 kHz

Info : STLINK v2 JTAG v31 API v2 VID 0x0483 PID 0x374B

Info : Target voltage: 3.263434

Info : STM32L072CZYx.cpu: hardware has 4 breakpoints, 2 watchpoints

adapter speed: 240 kHz

target halted due to debug-request, current mode: Thread 

xPSR: 0xf1000000 pc: 0x08002da8 msp: 0x20005000

STM32L0: Enabling HSI16

adapter speed: 4000 kHz

** Programming Started **

auto erase enabled

Info : Device: STM32L0xx (Cat.5)

Info : STM32L flash has dual banks. Bank (0) size is 96kb, base address is 0x8000000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000000e msp: 0x20005000

wrote 36864 bytes from file Debug/mlm32l07x01.elf in 5.673004s (6.346 KiB/s)

** Programming Finished **

** Verify Started **

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20005000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20005000

verified 35012 bytes in 0.204641s (167.080 KiB/s)

** Verified OK **

** Resetting Target **

adapter speed: 240 kHz

shutdown command invoked

What I see on board is 4 LEDs blinking all the time. If I am not wrong, the PingPong example should send the PING message directly and just turn on the blue LED. However, when I use a UART terminal, this is what I see (in a loop):

0690X0000060RnHQAU.pngThe PING message is not shown (I assume that the board is not even transmitting). When I try to debug the program to investigate the problem I get this error:

0690X0000060RnvQAE.png

I am working with a virtual machine with Windows 10 as host. I updated the ST-Link to the latest version and I am just using one B-L072Z-LRWAN1 board to verify that it transmits a message.

Does anyone have an idea of what is happenning?

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Aug 6, 2018 1:00 PM UTC

You need to make sure not to enable Low Power mode for the build, as this will result in debugger disconnection. Make sure you have the define LOW_POWER_DISABLE

Sorry not using Eclipse or OpenOCD tools

The DISCO board has it's own Ping-Pong build, the examples worked in Keil as I recall, but you might have to adjust the project options/defines to reflect the Radio Band used in your jurisdiction. And the frequencies, bands, and radio settings would need to be coherent across all nodes.

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

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Aug 6, 2018 1:00 PM UTC

You need to make sure not to enable Low Power mode for the build, as this will result in debugger disconnection. Make sure you have the define LOW_POWER_DISABLE

Sorry not using Eclipse or OpenOCD tools

The DISCO board has it's own Ping-Pong build, the examples worked in Keil as I recall, but you might have to adjust the project options/defines to reflect the Radio Band used in your jurisdiction. And the frequencies, bands, and radio settings would need to be coherent across all nodes.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
pbdiazam
pbdiazamAuthor
Associate II
Aug 6, 2018 2:20 PM UTC

I did it adding '#define DEBUG' in the debug.c file so the debug is enabled for different modes:

void DBG_Init(void)

{

#ifdef DEBUG

 GPIO_InitTypeDef gpioinitstruct = {0};

  

 /* Enable the GPIO_B Clock */

 __HAL_RCC_GPIOB_CLK_ENABLE();

 /* Configure the GPIO pin */  

 gpioinitstruct.Mode  = GPIO_MODE_OUTPUT_PP;

 gpioinitstruct.Pull  = GPIO_PULLUP;

 gpioinitstruct.Speed = GPIO_SPEED_HIGH;

  

 gpioinitstruct.Pin  = (GPIO_PIN_12 | GPIO_PIN_13| GPIO_PIN_14 | GPIO_PIN_15);

 HAL_GPIO_Init(GPIOB, &gpioinitstruct);

 /* Reset debug Pins */

 HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_RESET);

 HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, GPIO_PIN_RESET);

 HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);

 HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);

 __HAL_RCC_DBGMCU_CLK_ENABLE( );

 HAL_DBGMCU_EnableDBGSleepMode( );

 HAL_DBGMCU_EnableDBGStopMode( );

 HAL_DBGMCU_EnableDBGStandbyMode( );

  

#else /* DEBUG */

 /* sw interface off*/

 GPIO_InitTypeDef GPIO_InitStructure ={0};

  

 GPIO_InitStructure.Mode  = GPIO_MODE_ANALOG;

 GPIO_InitStructure.Pull  = GPIO_NOPULL;

 GPIO_InitStructure.Pin  = (GPIO_PIN_13 | GPIO_PIN_14);

 __GPIOA_CLK_ENABLE() ;  

 HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);

 __GPIOA_CLK_DISABLE() ;

  

 __HAL_RCC_DBGMCU_CLK_ENABLE( );

 HAL_DBGMCU_DisableDBGSleepMode( );

 HAL_DBGMCU_DisableDBGStopMode( );

 HAL_DBGMCU_DisableDBGStandbyMode( );

 __HAL_RCC_DBGMCU_CLK_DISABLE( );

#endif

}

Thank you so much! The debugger is working now.