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

Binary from nRF51882_QFAC wont run on QAFF

Hi Guys

I've got a strange problem where a binary that works fine on a nRF51822 QFAC does not run on a QFAA

I know that the difference between these two devices is the RAM size, so I did used some code that malloc's various sizes of memory to determine how much is available and on the QFAA I'm seeing

2304 bytes (allocation in 16 byte steps)

On both devices, because I set the linker (GCC) directive file to specify the device only has 16k memory

MEMORY { FLASH (rx) : ORIGIN = 0x0001C000, LENGTH = 0x24000 RAM (rwx) : ORIGIN = 0x20002800, LENGTH = 0x1800 }

If I change the RAM size in the linker and recompile and re-run on the QFAC I see that it has more memory, as my RAM test returns 19024 bytes

But.. These figures don't tally

i.e 2304 + 16384 does not equal 19024

BTW. I'm using the S130 SoftDevice, and just running a simple application which advertises and accepts a connection (so that I can send serial data to the device)

If I recompile and upload to the QFAA rather than copying the binary that was running on the QFAC, the application does not run correctly

The Advertising data is not getting setup correctly and although I can see the device I can't connect to it using a test app (Light Blue running on an iPad)

So I suspect I have some sort of RAM allocation issue

But at the moment this isnt making any sense to me at all.

BTW. I thought it may be a Programmer issue (I'm using a JLInk) but I've tried reading back the code and it does seem to program both devices the same.

I do have another SWD programmer I could try, but this does look like a RAM issue to me.

Does anyone have any ideas what is going one ?

Thanks

Roger

Parents
  • @RK

    I've not tried running it in the debugger. That was my next step.

    Whats strange is that its not actually crashing.The QFAA the device is advertising name does not seem to be set by the code.

    I'm using MBED, and it has a default advertising name "nRF51", which is what I see. So it looks like the MBED function to set the device name is failing on one device and not on the other.

    Yes... MBED is a complication as it wraps the SD calls, so I should probably re-code it calling the SD API directly, but its still strange it works on one device and not the other

    But as you say, its most likely a RAM issue. I will see if I can moved the stack down a bit.

Reply
  • @RK

    I've not tried running it in the debugger. That was my next step.

    Whats strange is that its not actually crashing.The QFAA the device is advertising name does not seem to be set by the code.

    I'm using MBED, and it has a default advertising name "nRF51", which is what I see. So it looks like the MBED function to set the device name is failing on one device and not on the other.

    Yes... MBED is a complication as it wraps the SD calls, so I should probably re-code it calling the SD API directly, but its still strange it works on one device and not the other

    But as you say, its most likely a RAM issue. I will see if I can moved the stack down a bit.

Children
No Data
Related