- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparently IntDefaultHandler is being called with errno as ENOMEM
#define ENOMEM 12 /* Not enough space */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Please increase the heap size by selecting System in Design wide resources and choosing heap size.
Please share your project so that we can check this at our end as well.
Thanks and regards
Harigovind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We're tight on memory space.
Why would a register write use heap space? It's an address macro... what does that then trigger?
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That worked (or at least now runs ). I'll only access registers completely in future.
Thank you.