cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-2

RAlma.1
Associate III

Hi,

I have a STEVAL-ID008V2 evaluation board which has a BueNRG2 BLE chip. SDK that I got from the ST website has project examples for this evaluation board. Looking at the codes examples, below method handles the low power mode functionality.

 /* Device Power Save Management Procedures */

  BlueNRG_Sleep(SLEEPMODE_NOTIMER, 0, 0);

However, the second argument to this function (wakeup GPIO pin selection/mask) has been set to zero, but according to the reference manuals and the datasheet the second argument must be one of the following only.

/** @brief Wakeup source IO9 Mask */

#define WAKEUP_IO9  0x0001

/** @brief Wakeup source IO10 Mask */

#define WAKEUP_IO10 0x0002

/** @brief Wakeup source IO11 Mask */

#define WAKEUP_IO11 0x0004

/** @brief Wakeup source IO12 Mask */

#define WAKEUP_IO12 0x0008

/** @brief Wakeup source IO13 Mask */

#define WAKEUP_IO13 0x0010

my question is why it has been set to zero and what would be the expected behaviour?

Many thanks,

4 REPLIES 4
Sebastien DENOUAL
ST Employee

Hi @Community member​ ,

This parameter is used to select a wakeUp source on GPIO.

In most of code examples, this wake up on GPIO functionality is not used and so this parameter is left to 0 - It requires to be set only if needed with correct value.

You may also have a look to AN4820 : BlueNRG-2 low power mode.

FYI, we do propose a code example in BlueNRG-2 SDK which implements the different low power mode :

.\BlueNRG-1_2 DK 3.2.2\Project\BlueNRG1_Periph_Examples\Micro\Sleep_Test

Regards,

Sebastien.

RAlma.1
Associate III

Hi,

By saying "it is not needed", I assume in those particular examples

  • Either the device is not going into to the sleep mode at all or
  • It periodically sleeps and wakes up on a timer

hence, selecting a wakeup source is not needed.

I am asking on this matter because on my prototype board that line of sleep functionality code is causing a lot of connection problem with the JLINK/V2 SWD debugger. When I comment out that line sleep functionality the debugger connection is always OK, it don't comment it out , the connection fails and I have to pullup the IO7 and hard reset to recover the debugger connection.

Many thanks,

Roosbeh

Hi @Community member​ ,

Indeed, you are right - this is not needed in that particular example.

By default using following line :  BlueNRG_Sleep(SLEEPMODE_NOTIMER, 0, 0);

It means that application is requesting to enter SLEEP mode forever without any wakeup condition ( Notimer, no GPIO).

Anyway, this is "only" an application request. If you look to BlueNRG_Sleep() source code, you will noticed that the real applied sleep mode is the result of a negotiation between timer, BLE stack and application.

Considering in ST code example, BLE is used (connected mode or advertising) : sleep mode applied is SLEEP_WITHTIMER as BLE stack needs to wake up device at next connection/advertising event.

In your final application, you may have different needs : you may request to wake-up on GPIO or even a timer. At this level when calling BlueNRG_Sleep() function => This is only application wishes.

More details in  AN4820 : BlueNRG-2 low power mode.

About debug probe issue : when the BlueNRG-2 is entering sleep mode... Cortex-M0 core is switched off and you can not attached anymore debug probe. It explains connection issue you are facing.

During prototyping phase, I would advise to comment call to BlueNRG_Sleep() to ease flash and debug.

Alternatively, to ease flash, you can maintain IO7 to high level when powering BlueNRG-2 . This will force BlueNRG-2 to enter bootloader mode - In this mode, Cortex-M0 is always ON allowing easy connection of your J-link probe.

Regards,

Sebastien.

RAlma.1
Associate III

Hi,

Many thanks for your help regarding the Low power mode. it has been really helpful.

I have another query regarding the RF test using the BlueNRG GUI tool.

I have been running some RF packet error rate between my custom board and STEVAL-1DB008V2 board. I have connect both boards to the GUI tool. Configuring my custom board as Tx and ST evaluation board as Rx works well hence I can verify the number packets received using the GUI.

however, when I configure my custom board as Rx and ST evaluation board as Tx is not working as number packet shows as zero on the GUI after.

RF error packet rate test

Custom board transmitter---> ST Eval board receiver ( works fine)

Custom board Receiver<---- St Eval board transmitter (Number of received packets shows zero)

I wonder if you could suggest anything please.

thanks.