I have been developing a BLE project using a design for NRF51822 QFABB2, which should have been a revision 2 chip with 128K flash/ 16Kmem. I recently built a second batch of boards and I received NRF51822 QFABC0, which should have been revision 3, direct replacement for the QFABB2 and did not require hardware or software changes. However, the firmware would not load. Switching to pyocd to do the loading, I found that it failed at "flash.py", line 140, in computeCrcs. This would occur as soon as the image size reported by mbed exceeded 16k. My project was using the S130 soft device and I eventually found out that the reported size does not including the soft device and that i was exceeding the 128k when the soft device was included. My program size should have been limited to 16k.
It is misleading because mbed reports 16k used of 256k available. I knew that I only had 128k available instead of 256k, but I didn't think I was close to 128k.
The other thing that threw me off was that the earlier QFABB2 version was also supposed to be a 128k flash, and my firmware ran on that version. When I went back and checked, the QFABB2 seemed to accept firmware image sizes up to 256k, almost as though it was a QFAA labeled as a QFAB.
I have ordered QFAC 256k/32k and expect that will resolve my problems. I wanted to share my experience and hope that it might help anyone else that runs into a similar problem.
I have been developing a BLE project using a design for NRF51822 QFABB2, which should have been a revision 2 chip with 128K flash/ 16Kmem. I recently built a second batch of boards and I received NRF51822 QFABC0, which should have been revision 3, direct replacement for the QFABB2 and did not require hardware or software changes. However, the firmware would not load. Switching to pyocd to do the loading, I found that it failed at "flash.py", line 140, in computeCrcs. This would occur as soon as the image size reported by mbed exceeded 16k. My project was using the S130 soft device and I eventually found out that the reported size does not including the soft device and that i was exceeding the 128k when the soft device was included. My program size should have been limited to 16k.
It is misleading because mbed reports 16k used of 256k available. I knew that I only had 128k available instead of 256k, but I didn't think I was close to 128k.
The other thing that threw me off was that the earlier QFABB2 version was also supposed to be a 128k flash, and my firmware ran on that version. When I went back and checked, the QFABB2 seemed to accept firmware image sizes up to 256k, almost as though it was a QFAA labeled as a QFAB.
I have ordered QFAC 256k/32k and expect that will resolve my problems. I wanted to share my experience and hope that it might help anyone else that runs into a similar problem.