porting an nRF52 SES project to nRF51

I have the same application that runs on both nrf51 and nrf52 MCUs. The Bluetooth in the application uses SoftDevice and not the SDK primarily because I started with the pc-driver which uses just SoftDevice. The nRF51 project is Keil and I want to migrate it to SES. I know there is a lot of noise about this but it is proving to be very difficult to do as the project, being just and example in the peripheral directory has a lot of include files, preprocessor values, etc. that must be configured. The import methods that I have followed on the Segger and Nordic sites have not done these configurations.

So instead how hard would it be to take a SES project file from nrf52 using SoftDevice S140 and change it to an nrf51 project using S130? The names of my application files are the same in both cases. I dont know if replacing the S140 and nrf52 references to the corresponding ones for nrf51 would work..

Parents
  • Hello,

    It should not be a problem to convert the 52 project into an nRF51 project. The most important steps that come to mind are: 

    1. Update the linker settings to match the device

    2. Change relevant preprocessor symbols (e.g. S132 -> S130).

    3. Change the startup files 

    If you are able to share your project, I can try to convert your 52 project to build for the nRF51. Need to know which package variant of the 51 you are using in that case.

  • I have made stabs at creating a SES based nrf51 project over the past years but basically gave up because there were simply too many things I didn't know and the locations of all the sources and includes are pretty complex in the SDK. I have decided to take another crack at it now that I am more familiar with the SDK and have looked into the raw project files of the SES and Keil projects and thought that maybe I could make use of them for the includes, pre-processors and source file configurations. So I tried the approach above but there were too many details about the MCUs I simply was unsure about.

    However, I do have an nRF52 and nRF51 project that do exactly the same thing. My application code for the two are almost identical as there are not too many differences between the SoftDevice S139 and S140 API calls. So I am working on two approaches to make the Keil to SES port. The first is the one referenced here. The second is that I started a new SES project from scratch based on the nRF51822 (that for the nRF51 DK) mcu. I then used the Keil project files to get the includes, preprocessors, and source files. I got a LOT further with this approach BUT got stuck on the fact that the 'arm_startup_nrf51.s' of the SDK includes a 'startup_config.h' file, but that file does not exist. I think if I got that file then the project would at least build (might need further tweaks)..

    IN any case, I attach my nrf52 project. It is to  be placed in the examples/peripherals directory. of the 17.1.0 SDK. It expects a 140 SoftDevice HEX file in the components/softdevice/s140/hex directory.

    Okay, well I would LIKE to send an attachment and I see that attachments can somehow be added but Ifor the life of me I cannot see how to do that! (Its not an image or video file.)

  • I already have the 12.3.0 SDK so I placed the project in the examples/peripherals directory and set SDK_ROOT=../../../../../../

    However, when building I get 

    '-mfloat-abi=hard': selected architecture lacks an FPU

    I don't have a DK connected; I was just trying to build. Wrong path to SDK? I think I counted the right number of  directories from the project to the base of the SDK.

  • Sorry, I'm not sure what happened there. I have re-uploaded the attachment in my previous post. This version does not select the hardware FPU (shouldn't have been possible to select it in the first place as there is no FPU on the M0).

  • Got the same result. Is there a way I can de-select FPU?

  • I removed the FPU in my reuploaded attachment 7028.nrf51_ses.zip. Did you try to build this with SES v.5.x?

  • I can't explain it but when I downloaded it I got the same project 4682.nrf51_ses.zip.. When I tried it again I got 8244.nrf51_ses.zip. This afternoon I tried the link in your last message and I got 7028.nrf51_ses.zip. This one built. THANKS!!

Reply Children
No Data
Related