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
  • Hi Edvan,

    I have used the makefile from "\examples\peripheral\blinky\pca10028\s130\armgcc" this path and in. ld file we have changed to the memory sizes as you mentioned.

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

    But device is not booting after flashing. we have also flashed softdevice at the beginning.

    But If i am directly flash the hex file from this path "\nRF5SDK1230\nRF5_SDK_12.3.0_d7731ad\examples\peripheral\blinky\hex\blinky._pca10028.hex", device is booting and blinking.

    So, we are assuming that either the memory addresses that are mentioned in .ld file have some issue or the defines and cflags that are set in makefile have some issue.

    The compiled hex file is of size 10kb and the actual hex file in this "\nRF5SDK1230\nRF5_SDK_12.3.0_d7731ad\examples\peripheral\blinky\hex\blinky._pca10028.hex" path is 7.25kb. These 2 file sizes should actually be same, but we could see the difference. 

    Can you please help in setting up?

    Thanks,

    Swetha.

  • Hello Swetha,

    Have you flashed the softdevice separately?

    swetha Paladugu said:

    I have used the makefile from "\examples\peripheral\blinky\pca10028\s130\armgcc" this path and in. ld file we have changed to the memory sizes as you mentioned.

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

    But device is not booting after flashing. we have also flashed softdevice at the beginning.

     Did you compile this using an armgcc compiler, or is this after you ported it to SES?

    What SDK are you using? Where did you find the RAM settings? And what are your flash settings? In SDK12.3.0, the settings are:

      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x200013c8, LENGTH = 0x6c38

    Perhaps you can try these settings.

    Does the LEDs blink if you test the pca10028\blank\armgcc makefile? This file doesn't require a softdevice. 

    BR,

    Edvin

  • Hi Edvan,

    I am using armgcc compiler itself, I'm trying to advertise ble..

    But from  err_code = sd_softdevice_enable(p_clock_lf_cfg, softdevice_fault_handler); called form ble_stack_init();

    it is going to SVC_Handler and crashing.

    I am able to flash the blinky example with the below memories so i'm using the same for advertising ble.

    MEMORY
    {
    FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x40000
    RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x2000
    }

    these are my makefile flags:

    # C flags common to all targets
    CFLAGS += -DBOARD_PCA10028
    CFLAGS += -DSOFTDEVICE_PRESENT
    CFLAGS += -DNRF51
    CFLAGS += -DS130
    CFLAGS += -DBLE_STACK_SUPPORT_REQD
    CFLAGS += -DSWI_DISABLE0
    CFLAGS += -DNRF51802
    CFLAGS += -DNRF_SD_BLE_API_VERSION=2
    CFLAGS += -mcpu=cortex-m0
    CFLAGS += -mthumb -mabi=aapcs
    CFLAGS += -Wall -Werror -O0 -g3
    CFLAGS += -mfloat-abi=soft
    # keep every function in separate section, this allows linker to discard unused ones
    CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
    CFLAGS += -fno-builtin --short-enums

    # C++ flags common to all targets
    CXXFLAGS += \

    # Assembler flags common to all targets
    ASMFLAGS += -x assembler-with-cpp
    ASMFLAGS += -DBOARD_PCA10028
    ASMFLAGS += -DSOFTDEVICE_PRESENT
    ASMFLAGS += -DNRF51
    ASMFLAGS += -DS130
    ASMFLAGS += -DBLE_STACK_SUPPORT_REQD
    ASMFLAGS += -DSWI_DISABLE0
    ASMFLAGS += -DNRF51802
    ASMFLAGS += -DNRF_SD_BLE_API_VERSION=2

    Please help me in resolving the crash issue.

  • So what does sd_softdevice_enable() return? 

    err_code = sd_softdevice_enable(...);

    err_code = ?

    What sort of HW are you running this on? You say that it is an nRF51 module. Does this module have an external LFXTAL?

     

    Edvin said:
    Does the LEDs blink if you test the pca10028\blank\armgcc makefile? This file doesn't require a softdevice. 

     Did you test this? Did it compile? Does it blink anything? I don't know if your module has any LEDs. Have you tried to compile without eclipse, using the terminal command "make"?

    We do not support Eclipse. It may very well be that you will  be able to set it up, but there are a lot of things that has to be set up correctly in order for it to work, so I would suggest that you test something that we know works before you enter this. 

    At this point, we don't know whether the application you are testing works with the module you are using, and we don't know if your eclipse setup is working. 

    This is why I want you to test an example using the armgcc makefile directly, flash it using nrfjprog, and check that it is working. Once you know the example is working, then you can try to open it in Eclipse, and see if you have the same behavior. 

  • Hi Edvan,

    Please see the screenshot that i shared you with my last post. It doesn't return from sd_softdevice_enable() function, it gets stuck in SVC_Handler as what we can see from the call stack.

    The hardware that i am using is NRF51802.

    We have tried the blinky example. My module doesn't have led's but had a motor connected to it.

    When i flashed the blinky example, my motor is getting rotated. The gpio pins might have matched. So in this way we confirmed the blinky is working. In the same blinky example, i have removed the blinky code and drived the gpio pins to make my motor rotate.. And it worked i could successfully able to rotate my motor. All this i have been doing with eclipse. Then we went on a task to make the ble advertise.

    Thanks,

    Swetha.

Reply
  • Hi Edvan,

    Please see the screenshot that i shared you with my last post. It doesn't return from sd_softdevice_enable() function, it gets stuck in SVC_Handler as what we can see from the call stack.

    The hardware that i am using is NRF51802.

    We have tried the blinky example. My module doesn't have led's but had a motor connected to it.

    When i flashed the blinky example, my motor is getting rotated. The gpio pins might have matched. So in this way we confirmed the blinky is working. In the same blinky example, i have removed the blinky code and drived the gpio pins to make my motor rotate.. And it worked i could successfully able to rotate my motor. All this i have been doing with eclipse. Then we went on a task to make the ble advertise.

    Thanks,

    Swetha.

Children
No Data
Related