BLE Nano 2 + uVision: "Code size ... exceeds maximum allowed"


Hello Readbear community!

I just received my Nano 2 and I was working through the initial “getting started guide”.
I verified that the Nano 2 was working out of the box, and then followed the Nordic SDK user guide:

Everything looked good, and I had no problem following the instructions, so I’m a bit confused that I’m unable to compile the code for the heart rate sensor (ble_app_hrs) as per the guide. I get this:

._build\nrf52832_xxaa.axf: error: L6050U: The code size of this image (37936 bytes) exceeds the maximum allowed for this version of the linker.

I believe the free version of Keil uVision is capped at 32k for the image size, but everything I’ve read seems to imply there’s no reason I should be getting even close to that. I haven’t modified the code in any way. Have I done something wrong?
Here’s my best guess so far (and this is a total guess, as I’m 100% new to this): Perhaps I’m missing a step to setup the softdevice? The guide does mention “if using softdevice…”, but at no point is there any info to describe how to add a softdevice to the project. I read somewhere that the softdevice doesn’t count towards your image size, so perhaps I’m having to add all the code that would normally be in the softdevice into my image?
I was poking through the .map file generated for the project, but I wasn’t able to glean much from it. It looks like the bulk of the image is support code, not the app itself.

Any help would be greatly appreciated!


Hi @abucior,

That’s exactly what happens to you. That guide assume that you have installed a full version of the Keil uVision. You can try building a simple gpio example which does not utilize the BLE functionality to verify the code limitation.

Best regards,