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

How to create a Makefile based project?

Hi,

I am new to creating project from scratch.

I want to use nRF51802 module. From few support tickets i have come to know that  SDK version 12.3 and SoftDevice S130 version 2.0.x  are the compatible versions for nRF51802 module. Are these the latest combination for nRF51802? What should i use?

And i want to create a project which is IDE independent project, a Makefile project.

Can anyone please guide me how to create a makefile project for nRF51802 module?

Thanks,

Swetha.

Parents
  • Hello Swetha,

     

    I want to use nRF51802 module. From few support tickets i have come to know that  SDK version 12.3 and SoftDevice S130 version 2.0.x  are the compatible versions for nRF51802 module.

     That is correct. SDK12.3.0 is the latest SDK that supports the nRF51 series. 

    Please note that the nRF51802 has 256kB Flash and 16kB RAM, while the nRF51822 and nRF51422 (which the SDK examples are written for) have 32kB RAM, so you probably need to adjust this in the example's settings.

     

    And i want to create a project which is IDE independent project, a Makefile project.

     All the examples in the SDK are IDE independent. That is, there are IAR, Keil (µVision), and armgcc makefiles for all the examples. 

    To adjust the RAM settings, you need to consider whether or not the application uses the SoftDevice or not. Let me describe both cases briefly. Since you mention Makefile project, I will use that as the example:

    Without the Softdevice:

    Look at the example SDK12.3.0\examples\peripheral\blinky\pca10028\blank\armgcc.

    Look at the file blinky_gcc_nrf51.ld in this folder. The 9th line says:

    RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x8000

    The RAM starts at 0x20000000, and has length 0x8000 (=decimal 32768, which is 32kB (32*1024)).

    If you want to compile this for the 16kB RAM variant of the chip, you need to change the size to 0x4000, which corresponds to 16kB.

    With the Softdevice:

    Look at the example SDK12.3.0\examples\ble_peripheral\ble_app_uart\pca10028\s130\armgcc

    Look at the file ble_app_uart_gcc_nrf51.ld in this folder. The 9th line says:

    RAM (rwx) :  ORIGIN = 0x20001fe8, LENGTH = 0x6018

    As you see, the RAM ORIGIN is moved. This is because the softdevice uses a portion of the flash. Note that this varies between the softdevice examples. It depends on the number of BLE services, the role and so on. You may also need to change this if you add/remove features from the project.

    What you need to make sure is that ORIGIN + LENGTH = Physical RAM SIZE, which in your case is 0x4000 (so 0x20004000, since the RAM start is still at 0x20000000, even if the softdevice uses some of it). This usually means that you need to subtract 0x4000 from the LENGTH parameter. In this case, it would mean:

    RAM (rwx) :  ORIGIN = 0x20001fe8, LENGTH = 0x2018.

    This should at least be something to get you started. Let me know if anything was unclear.

    BR,

    Edvin

Reply
  • Hello Swetha,

     

    I want to use nRF51802 module. From few support tickets i have come to know that  SDK version 12.3 and SoftDevice S130 version 2.0.x  are the compatible versions for nRF51802 module.

     That is correct. SDK12.3.0 is the latest SDK that supports the nRF51 series. 

    Please note that the nRF51802 has 256kB Flash and 16kB RAM, while the nRF51822 and nRF51422 (which the SDK examples are written for) have 32kB RAM, so you probably need to adjust this in the example's settings.

     

    And i want to create a project which is IDE independent project, a Makefile project.

     All the examples in the SDK are IDE independent. That is, there are IAR, Keil (µVision), and armgcc makefiles for all the examples. 

    To adjust the RAM settings, you need to consider whether or not the application uses the SoftDevice or not. Let me describe both cases briefly. Since you mention Makefile project, I will use that as the example:

    Without the Softdevice:

    Look at the example SDK12.3.0\examples\peripheral\blinky\pca10028\blank\armgcc.

    Look at the file blinky_gcc_nrf51.ld in this folder. The 9th line says:

    RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x8000

    The RAM starts at 0x20000000, and has length 0x8000 (=decimal 32768, which is 32kB (32*1024)).

    If you want to compile this for the 16kB RAM variant of the chip, you need to change the size to 0x4000, which corresponds to 16kB.

    With the Softdevice:

    Look at the example SDK12.3.0\examples\ble_peripheral\ble_app_uart\pca10028\s130\armgcc

    Look at the file ble_app_uart_gcc_nrf51.ld in this folder. The 9th line says:

    RAM (rwx) :  ORIGIN = 0x20001fe8, LENGTH = 0x6018

    As you see, the RAM ORIGIN is moved. This is because the softdevice uses a portion of the flash. Note that this varies between the softdevice examples. It depends on the number of BLE services, the role and so on. You may also need to change this if you add/remove features from the project.

    What you need to make sure is that ORIGIN + LENGTH = Physical RAM SIZE, which in your case is 0x4000 (so 0x20004000, since the RAM start is still at 0x20000000, even if the softdevice uses some of it). This usually means that you need to subtract 0x4000 from the LENGTH parameter. In this case, it would mean:

    RAM (rwx) :  ORIGIN = 0x20001fe8, LENGTH = 0x2018.

    This should at least be something to get you started. Let me know if anything was unclear.

    BR,

    Edvin

Children
No Data
Related