- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
CYBLE-022001-00.
From PRoC BLE Registers TRM, Document No. 001-93112 Rev. *B, it says:
// To detect brown-outs firmware should do this on boot:
// 1. Set key= KEY16
// 2. Set KEY16= 0x3A71
// 3. If key==0x3A71 this was a brown-out event.
// Default Value: X
I implemented this as follows, but it appears to raise an exception on the processor when running.
Is there an unlock or something that has to occur before this register can be written to?
int BootTestAndEnableBodOnRestart(void)
{
// from PRoC BLE Registers TRM, Document No. 001-93112 Rev. *B
// To detect brown-outs firmware should do this on boot:
// 1. Set key= KEY16
// 2. Set KEY16= 0x3A71
// 3. If key==0x3A71 this was a brown-out event.
// Default Value: X
unsigned short key = CY_GET_REG16(CYREG_PWR_BOD_KEY);
CY_SET_REG16(CYREG_PWR_BOD_KEY,0x3A71);
return (key == 0x3A71);
}
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error is occurring because you are trying to access a 32 bit register using CY_SET_REG16. Please use macro CY_SET_REG32 instead.
Thanks and regards
Harigovind