2019-02-10 05:53 AM
The intend is to detect whether an array (size 256 bytes) is present in RAM at a location pointed to, and does not trap a HARDFAULT when the pointer written to it. A subsequent read from the same location should produce a value different from the value written. E.g. the complement or a value from a constant table. So a sequence such as :
typedef char barray[256];
char *ptr = /* a pointer from an array of pointers to barrays */ ;
*ptr = 0x55;
printf (*ptr == 0x55 ? "That RAM !" : "That's NOT RAM");
result in the result being printed without causing a HARD FAULT;
Further the HARDFAULT mechanism should not be disabled, so that it will still trap a HARDFAULT for other unwritable memory regions. If have considered the bitbanded memory space for this.
2019-02-10 06:12 AM
Read-only region is the FLASH area, or its chip ID region.
Note: F7 don't have bitbanded region.
2019-02-10 06:41 AM
Could you use the MPU and manage the handling in a memory manager fault?
2019-02-10 07:00 AM
No memory manager in a F103C8T6 , or does it have ?