As a follow up from devzone.nordicsemi.com/.../, I am now trying to find out if I am getting all of the memory settings put together correctly. When I have them at higher values then the program crashes and targets 0x00000000 rather than going to the error handler function, however, if I set it to a smaller value that I suspect is the correct value, it enters the error handler but is giving me a error 0x00000004 error which I believe is mapping to a not enough memory error. If somebody can take a moment and check my understanding, that would be great.
I'm using an nrf51822 qfaa chip which says it has 256k flash and 16k ram.
I'm using sdk12.2 which is using the s130 v2.0 soft device (2.0.1) and has the listed memory requirements shown on page 52 in infocenter.nordicsemi.com/.../S130_SDS_v2.0.pdf as follows
So I have set the following configuration for my project,
I now do not enter 0x00000000 upon crashing after a few main loops, but instead I crash right at the start when the following function is called and then checked.
err_code = softdevice_enable(&ble_enable_params);
APP_ERROR_CHECK(err_code);
the error is 0x00000004 and the program never is able to make a full loop.
If my understanding is correct, the 'size' value on memory areas is measured in bytes correct?
Edit: I just stepped through the softdevice enable code and it is comparing the starting memory value against the expected value of 0x20001fe8 against my value I set. I originally started with this value in the project but since it wasn't in line with the documentation, I changed it. I have since adjusted and changed IRAM1 to 0x20001fe8 and size value of 0x1e98.
I am still crashing and entering 0x00000000.
Edit 2: I just started looking at other softdevice options because I am wondering if maybe this chip is just too small in memory to use the s130 softdevice, so I moved over to s110 in sdk10, I selected the ble_beacon example and changed the target chip to the nrf51822_xxaa target. I then modified the start and size values to what seemed appropriate, but according to the s110 documentation the app IRam1 starting address looks like it should be at 0x20008188 but the project had previously set it at 0x20002000. Since the memory in the chip can't go up to 8188 I kept it at the preset value. It all seemed to work fine. Why is it that the doucentation says the default and minimum ram values for the s110 is larger than the example code settings, and then when I use the example code settings it works fine? infocenter.nordicsemi.com/.../S110_SDS_v2.0.pdf