cancel
Showing results for 
Search instead for 
Did you mean: 

STEVAL-SMARTAG1 - debugging: CPU could not be halted

Hi,

I am using Keil v5.28 and want to debug the code on STEVAL-SMARTAG1. The module uses 1.8V to power its MCU. SWD pins are enabled in the app.

---------------------------

After 4-5sec after starting the debugging of the STEVAL-SMARTAG1 module I loose the connectivity to the target (it works fine within the first 4sec). The watched variables are not updated since then. Tested both nucleo ST-LINK/2-1 (external target) and j-link edu mini:

jlink reports: **JLink Warning: CPU could not be halted"

st-link gives the following message when I try to stop the debugger or stop the app: "Could not stop Cortex-M device".

So both debuggers experience very similar issues.

VTref looks good: VTarget = 1.794V

I have no problem to stop the MCU within the first 3sec. The problem starts showing up after 4sec.

------------------

I know that the j-link edu mini does not support 1.8V (at least theoretically because I saw it working with such 1.8V powered boards). So it may fail with this voltage as per Segger information.

But the the nucleo ST-LINK/2-1 is recomended for STEVAL-SMARTAG1 (at least the ST manual shows this programmer as useful). That's why it is interesting.

I wonder if you have any experience like this.

I would appreciate any suggestions.

Thanks a lot

Bogdan

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

Thank you for your comments.

The original problem was partially caused by low quality CR2032 and relatively big power consumption.

I replaced the battery and optimized the app to reduce the power consumption of the board (the current is being monitored all the time now).

BTW. I do not use the original firmware ( I prefer simple code I could understand)

The goal is to learn STM32L0 LPM + play with the sensors.

The SMARTTAG hardware is quite nice - can easily turn on/off the power from the external sensors so I like it very much.

The only thing I miss is the UART RX pin + I2C pins.

But the overall experience is very positive.

Thanks,

Bogdan

View solution in original post

3 REPLIES 3

​Hello,

For those who care:

I tested the connectivity on J-LINK EDU MINI as well and got similar results.

I investigated the CR2032 and found that some of them in my collection dropped the voltage for short amount of time during turning on the LED.

So I replaced them with quality ones have have no problems since then.

Bogdan

Salvatore Curti
ST Employee

​Hello Bogdan,

I hope my answer it is useful for you.

1) The code had been write to preserve the battery charge. So the CPU go on to stop mode and it wake up only the data must be written in the NFC eeprom tag or the data must be read by NFC device (mobile phone with ST NFC Sensor App).

If you want to debug the code, to must avoid that the CPU go on to stop mode.

To avoid that the CPU go on to stop mode you must uncomment the line 63 in the file SmarTagConf.h:

//#define SMARTAG_ENABLE_DEBUG

There are a known issues, as you can read in the release note:

ISSUE

  • Due to flash size constraints on STEVAL-SMARTAG1:
    • UART is not available
    • Binary generated by System Workbench for STM32 is not available (the IDE project is removed)
    • Debug mode is not available.

so, if it is necessary to use the debug modality, you can try to comment this code lines:

#if defined(SMARTAG_ENABLE_DEBUG) || defined(SMARTAG_ENABLE_PRINTF)

#error Due to flash size constraints on STEVAL-SMARTAG1, SMARTAG_ENABLE_DEBUG and SMARTAG_ENABLE_PRINTF features are not available

#endif

in the file SmarTagConf.h (lines 68,69,70).

After building the code with Keil, if there is flash size constraints (I had try myself with Keil 5.27.1 and there is not flash size constraint), you can try youself (there is not this possibility in the FW) to enable the only necessary code lines for debugging.

2) The debugging starting after 4-5sec why there is enabled the autostart modality after 5 sec with the code line 44 in the file SmarTagConf.h:

#define SMARTAG_AUTOSTART_SECONDS 5.

Comment the following define to avoid this.

Regards,

Salvatore Curti.

Hello,

Thank you for your comments.

The original problem was partially caused by low quality CR2032 and relatively big power consumption.

I replaced the battery and optimized the app to reduce the power consumption of the board (the current is being monitored all the time now).

BTW. I do not use the original firmware ( I prefer simple code I could understand)

The goal is to learn STM32L0 LPM + play with the sensors.

The SMARTTAG hardware is quite nice - can easily turn on/off the power from the external sensors so I like it very much.

The only thing I miss is the UART RX pin + I2C pins.

But the overall experience is very positive.

Thanks,

Bogdan