Port Ruuvi project to Nrf52840

Dear Community,
I want to port the Ruuvi Project to Nrf52840 (this using BLE stack S140 ).
So I want to know whether it is feasible or not ?
Which parts should I take care ?

Thank you very much

Hello @H_u_Lam

Porting is pretty straightforward, there might be some missing 52840-specific edge cases in ruuvi.drivers.c . Pull requests are welcome if you run into those.

It might be easiest for you to take “Kalervo” as the base project, as it already has S140 on 52811. Just adjust the 52811 definitions to 52840 and increment the Flash + RAM to appropriate sizes.

Hello @otso,
I could not find the the “Kalervo” project . Could you let me know which branch/tags should to checkout ?
Thanks

Hello @otso,
I checkout the master and able to build the “Kalervo” project but it got the issue
1> Linking kalervo.elf
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .text is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .sdh_soc_observers is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .sdh_ble_observers is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .log_const_data is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .nrf_balloc is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .sdh_state_observers is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .sdh_stack_observers is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .log_backends is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .nrf_queue is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .rodata is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: .data is too large to fit in FLASH memory segment
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: error: section .heap overlaps absolute placed section .stack
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/gcc/arm-none-eabi/bin/ld: Output/kalervo Debug/Obj/main.o: in function main': 1> D:\00_Working\04_Support\00_source\ref_new_ruuvi\ruuvi.firmware.c\src/main.c:108: undefined reference to integration_tests_run’

Do you know why ?

Thanks

Hello @otso,
I’m able to build the the “Kalervo” project by changing the FLASH size and RAM size as below
FLASH_PH_START=0x0
FLASH_PH_SIZE=0x100000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x40000
FLASH_START=0x26000
FLASH_SIZE=0xda000
RAM_START=0x20001d70
RAM_SIZE=0x3e290

Thank you very much for your support

Hi @H_u_Lam,

Happy to hear that the problem was solved. nRF52811 projects can build only size-optimized release variants, but 52840 has enough space for debug builds. Remember to replace the nRF52811-definitions in .emProject and makefiles with nRF52840 so your code complies correctly for the target board. You might also want to enable the hardware FPU etc.