Feature #5826
openSAM4S4BA support in firmware
0%
Description
This ticket is about supporting the SAM4S4BA from our firmware, in addition to the SAM3S4BA, SAM3S8BA and SAM4SD8BA we've been using so far for simtrace2 devices.
This is a spin-off of #1706
Related issues
Updated by laforge 12 months ago
- Related to Feature #1706: Hardware / Circuit board update for SAM3S based SIMtrace2 with 1.8V/5V support added
Updated by laforge 12 months ago
It looks like the flash controller is compatible, but the flash properties are different.
Dumping the flash descriptor on a simtrace2 I had with SAM3S2BA:
FL_ID = 0x000f0711 FL_SIZE = 131072 FL_PAGE_SIZE = 256 FL_PLANE[0] = 131072 FL_NB_LOCK[0] = 16384 FL_NB_LOCK[1] = 16384 FL_NB_LOCK[2] = 16384 FL_NB_LOCK[3] = 16384 FL_NB_LOCK[4] = 16384 FL_NB_LOCK[5] = 16384 FL_NB_LOCK[6] = 16384 FL_NB_LOCK[7] = 16384
Dumping the flash descriptor on a simtrace2 I have re-worked with SAM4S4BA:
FL_ID = 0x000f0730 FL_SIZE = 262144 FL_PAGE_SIZE = 512 FL_PLANE[0] = 262144 FL_NB_LOCK[0] = 8192 FL_NB_LOCK[1] = 8192 FL_NB_LOCK[2] = 8192 FL_NB_LOCK[3] = 8192 FL_NB_LOCK[4] = 8192 FL_NB_LOCK[5] = 8192 FL_NB_LOCK[6] = 8192 FL_NB_LOCK[7] = 8192 FL_NB_LOCK[8] = 8192 FL_NB_LOCK[9] = 8192 FL_NB_LOCK[10] = 8192 FL_NB_LOCK[11] = 8192 FL_NB_LOCK[12] = 8192 FL_NB_LOCK[13] = 8192 FL_NB_LOCK[14] = 8192 FL_NB_LOCK[15] = 8192 FL_NB_LOCK[16] = 8192 FL_NB_LOCK[17] = 8192 FL_NB_LOCK[18] = 8192 FL_NB_LOCK[19] = 8192 FL_NB_LOCK[20] = 8192 FL_NB_LOCK[21] = 8192 FL_NB_LOCK[22] = 8192 FL_NB_LOCK[23] = 8192 FL_NB_LOCK[24] = 8192 FL_NB_LOCK[25] = 8192 FL_NB_LOCK[26] = 8192 FL_NB_LOCK[27] = 8192 FL_NB_LOCK[28] = 8192 FL_NB_LOCK[29] = 8192 FL_NB_LOCK[30] = 8192 FL_NB_LOCK[31] = 8192So we can see that in addition to the expected difference in total flash size
- the page size (256 -> 512) and
- the lock region size (16k->8k) has changed.
Updated by laforge 12 months ago
According to https://github.com/Microchip-Ethernet/EVB-KSZ9477/blob/0802dd40dc391aa580d15c59cbc0203eb8c699bc/KSZ/Atmel_SOC_SAMA5D3/buildroot/host/opt/sam-ba/applets/sam4s/libraries/libchip_sam4s/include/efc.h#L64 it seems that even atmel (at least in their softpack libraries) uses an hard-coded approach where the page size is a preprocessor #define
rather than resolved at runtime from the flash descriptor.