This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

error in gap_params_init or pstorage_init

I'm building the ble_hrs_app for my pca10000, I've made a couple of changes (to change the LEDS which show) and I'm building it with CrossWorks .. which I thought I knew how to do. Clearly I've bungled something up however. I have confirmed that the code starts at the softdevice reset handler, absolutely confirmed that.

If I run the code as written, it fails in pstorage_init() with an error code of 0x10, which is invalid address. If I comment out the bond_manager_init() (I don't really need it anyway on this, as there is no button, bonds would be destroyed automatically) it fails in gap_params_init() with an error code of 0x01.

What could cause errors like that? I've stepped into the disassembly for the second call, the registers are like this

r0 = 0x20003afc r1 = 0x0001a56c r2 = 0x0000000a

I can see the memory at r1 is the correct NORDIC HRM string and it's 0x0a bytes long. The memory at r0 contains a single byte 0x11 which is the correct permissions, two 4-bit fields in one bytes. So what would cause that call to fail?

ble_stack_init() has been called and that doesn't give any errors, timer_init() works, so some calls are ok.

What could I look for here?

... adding a couple of extra points ...

'Fail' in this case means the calls are returning errors and that's then going to the error handler where I'm breakpointing. There's no hardfault or other such errors.

Debugging the pstorage_init(), that return value of 0x10 is actually coming back from the flash page erase inside pstorage_init, and I believe at that level means 'Invalid Page', I checked the parameter to that call as well, the page passed in is 0xFF which, on a QFAA, should be perfectly valid.

Parents Reply Children
No Data
Related