This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
s340:platformio_ide_integration_for_the_nrf52840_feather_express_with_s340 [2020/03/29 22:26] orrmany |
s340:platformio_ide_integration_for_the_nrf52840_feather_express_with_s340 [2020/03/29 22:57] orrmany [Adding S340 support to Plaform IO] |
||
---|---|---|---|
Line 28: | Line 28: | ||
* On Windows: ''%HOMEDIR%\.platformio\packages\framework-arduinoadafruitnrf52\'' | * On Windows: ''%HOMEDIR%\.platformio\packages\framework-arduinoadafruitnrf52\'' | ||
-So, go to ''.../.platformio/packages/framework-arduinoadafruitnrf52/bootloader/feather_nrf52840_express/''. Copy the bootloader .zip (''0.3.0_s340_6.1.1.zip'') and .hex (''0.3.0_s340_6.1.1.hex'') from the build directory of the freshly modified bootloader package here. | -So, go to ''.../.platformio/packages/framework-arduinoadafruitnrf52/bootloader/feather_nrf52840_express/''. Copy the bootloader .zip (''0.3.0_s340_6.1.1.zip'') and .hex (''0.3.0_s340_6.1.1.hex'') from the build directory of the freshly modified bootloader package here. | ||
- | - Go to ''.../.platformio/packages/framework-arduinoadafruitnrf52/''. Modify ''boards.txt'' just like I did for the Arduino IDE. See sub-step "1" within the section [[s340:arduino_ide_integration_for_the_nrf52840_feather_express_with_s340#third_major_stepadd_s340_to_the_bsp|Second major step: replace the bootloader with the modified bootloader]] at the Arduino IDE adaptation page. | + | - Go to ''.../.platformio/packages/framework-arduinoadafruitnrf52/''. Modify ''boards.txt'' just like I did for the Arduino IDE. See sub-step "1" within the section [[s340:arduino_ide_integration_for_the_nrf52840_feather_express_with_s340#third_major_stepadd_s340_to_the_bsp|Second major step: replace the bootloader with the modified bootloader]] at the Arduino IDE adaptation page:<code> |
+ | # ---------------------------------- | ||
+ | # Bluefruit Feather nRF52840 Express s340 | ||
+ | # ---------------------------------- | ||
+ | feather52840_s340.name=Adafruit Bluefruit Feather nRF52840 Express w.ANT | ||
+ | |||
+ | # VID/PID for bootloader with/without UF2, Arduino + Circuitpython App | ||
+ | feather52840_s340.vid.0=0x239A | ||
+ | feather52840_s340.pid.0=0x8029 | ||
+ | feather52840_s340.vid.1=0x239A | ||
+ | feather52840_s340.pid.1=0x0029 | ||
+ | feather52840_s340.vid.2=0x239A | ||
+ | feather52840_s340.pid.2=0x002A | ||
+ | feather52840_s340.vid.3=0x239A | ||
+ | feather52840_s340.pid.3=0x802A | ||
+ | |||
+ | # Upload | ||
+ | feather52840_s340.bootloader.tool=bootburn | ||
+ | feather52840_s340.upload.tool=nrfutil | ||
+ | feather52840_s340.upload.protocol=nrfutil | ||
+ | feather52840_s340.upload.use_1200bps_touch=true | ||
+ | feather52840_s340.upload.wait_for_upload_port=true | ||
+ | feather52840_s340.upload.maximum_size=815104 | ||
+ | feather52840_s340.upload.maximum_data_size=237568 | ||
+ | #TODO: fix sizes above | ||
+ | |||
+ | # Build | ||
+ | feather52840_s340.build.mcu=cortex-m4 | ||
+ | feather52840_s340.build.f_cpu=64000000 | ||
+ | feather52840_s340.build.board=NRF52840_FEATHER | ||
+ | feather52840_s340.build.core=nRF5 | ||
+ | feather52840_s340.build.variant=feather_nrf52840_express | ||
+ | feather52840_s340.build.usb_manufacturer="Adafruit LLC" | ||
+ | feather52840_s340.build.usb_product="Feather nRF52840 Express" | ||
+ | feather52840_s340.build.extra_flags=-DNRF52840_XXAA {build.flags.usb} | ||
+ | feather52840_s340.build.ldscript=nrf52840_s340_v6.ld | ||
+ | feather52840_s340.build.vid=0x239A | ||
+ | feather52840_s340.build.pid=0x8029 | ||
+ | |||
+ | # SofDevice Menu | ||
+ | feather52840_s340.menu.softdevice.s340v6=0.3.0 SoftDevice s340 6.1.1 | ||
+ | feather52840_s340.menu.softdevice.s340v6.build.sd_name=s340 | ||
+ | feather52840_s340.menu.softdevice.s340v6.build.sd_version=6.1.1 | ||
+ | feather52840_s340.menu.softdevice.s340v6.build.sd_fwid=0x00B9 | ||
+ | |||
+ | # Debug Menu | ||
+ | feather52840_s340.menu.debug.l0=Level 0 (Release) | ||
+ | feather52840_s340.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 | ||
+ | feather52840_s340.menu.debug.l1=Level 1 (Error Message) | ||
+ | feather52840_s340.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 | ||
+ | feather52840_s340.menu.debug.l2=Level 2 (Full Debug) | ||
+ | feather52840_s340.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 | ||
+ | feather52840_s340.menu.debug.l3=Level 3 (Segger SystemView) | ||
+ | feather52840_s340.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 | ||
+ | </code> | ||
- Go to ''.../.platformio/platforms/nordicnrf52/boards/''. Copy ''adafruit_feather_nrf52840.json'' and name the copy as ''adafruit_feather_nrf52840_s340.json''. Change the following entries:<code json> | - Go to ''.../.platformio/platforms/nordicnrf52/boards/''. Copy ''adafruit_feather_nrf52840.json'' and name the copy as ''adafruit_feather_nrf52840_s340.json''. Change the following entries:<code json> | ||
+ | ... | ||
"ldscript": "nrf52840_s340_v6.ld", | "ldscript": "nrf52840_s340_v6.ld", | ||
+ | ... | ||
"softdevice": { | "softdevice": { | ||
"sd_flags": "-DS340", | "sd_flags": "-DS340", | ||
Line 36: | Line 92: | ||
"sd_version": "6.1.1", | "sd_version": "6.1.1", | ||
"sd_fwid": "0x00B9" | "sd_fwid": "0x00B9" | ||
- | }</code> | + | }, |
- | - Go to ''.../.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/linker''. Copy/duplicate the S140 linker script as nrf52840_s140_v6.ld. Modify the linker script memory settings just like I did for the Arduino IDE. See sub-step "2" within the section [[s340:arduino_ide_integration_for_the_nrf52840_feather_express_with_s340#third_major_stepadd_s340_to_the_bsp|Second major step: replace the bootloader with the modified bootloader]] at the Arduino IDE adaptation page. | + | ... |
+ | "name": "Adafruit Feather nRF52840 Express S340", | ||
+ | </code> | ||
+ | - Go to ''.../.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/linker''. Copy/duplicate the S140 linker script as nrf52840_s140_v6.ld. Modify the linker script memory settings just like I did for the Arduino IDE. See sub-step "2" within the section [[s340:arduino_ide_integration_for_the_nrf52840_feather_express_with_s340#third_major_stepadd_s340_to_the_bsp|Second major step: replace the bootloader with the modified bootloader]] at the Arduino IDE adaptation page. Modify the FLASH and RAM settings:<code> | ||
+ | FLASH (rx) : ORIGIN = 0x31000, LENGTH = 0xF4000 - 0x31000</code><code> | ||
+ | RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000</code> | ||
- Modify ''.../.platformio/packages/framework-arduinoadafruitnrf52/platform.txt'' file because the Adafruit bootloader is now 0.3.0:<code bash> | - Modify ''.../.platformio/packages/framework-arduinoadafruitnrf52/platform.txt'' file because the Adafruit bootloader is now 0.3.0:<code bash> | ||
# Bootloader version | # Bootloader version | ||
Line 43: | Line 104: | ||
tools.bootburn.bootloader.file={runtime.platform.path}/bootloader/{build.variant}/{build.variant}_bootloader-0.3.0_{build.sd_name}_{build.sd_version} | tools.bootburn.bootloader.file={runtime.platform.path}/bootloader/{build.variant}/{build.variant}_bootloader-0.3.0_{build.sd_name}_{build.sd_version} | ||
</code> | </code> | ||
+ | - Add the S340 API headers to ''.../.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/nordic/softdevice/''. | ||
+ | - Make ''s340_nrf52_6.1.1_API'' and the corresponding dir tree below it: Copy the ''include '' subdirectory of the S340 SoftDevice under this ''s340_nrf52_6.1.1_API'' subdirectory:<code txt>.../s340_nrf52_6.1.1_API | ||
+ | └── include | ||
+ | ├── ant_error.h | ||
+ | ├── ant_interface.h | ||
+ | ├── ant_parameters.h | ||
+ | ├── ble.h | ||
+ | ├── ble_err.h | ||
+ | ├── ble_gap.h | ||
+ | ├── ble_gatt.h | ||
+ | ├── ble_gattc.h | ||
+ | ├── ble_gatts.h | ||
+ | ├── ble_hci.h | ||
+ | ├── ble_l2cap.h | ||
+ | ├── ble_ranges.h | ||
+ | ├── ble_types.h | ||
+ | ├── nrf52 | ||
+ | │ └── nrf_mbr.h | ||
+ | ├── nrf_error.h | ||
+ | ├── nrf_error_sdm.h | ||
+ | ├── nrf_error_soc.h | ||
+ | ├── nrf_nvic.h | ||
+ | ├── nrf_sd_def.h | ||
+ | ├── nrf_sdm.h | ||
+ | ├── nrf_soc.h | ||
+ | └── nrf_svc.h | ||
+ | </code> | ||
+ | - Go to ''bootloader/feather_nrf52840_express''. You will find ''feather_nrf52840_express_bootloader-0.3.0_s**1**40_6.1.1.zip'' and ''feather_nrf52840_express_bootloader-0.3.0_s**1**40_6.1.1.hex'' here. Now copy the corresponding files or s340 as ''feather_nrf52840_express_bootloader-0.3.0_s**3**40_6.1.1.hex'' and ''feather_nrf52840_express_bootloader-0.3.0_s**3**40_6.1.1.zip'' from where you have built the modified bootloader with S340 (see page [[arduino:s340_softdevice_adafruit_nrf52840_feather_express|S340 SoftDevice & Adafruit nRF52840 Express Feather]] about how to build it). That is, the directory ''bootloader/feather_nrf52840_express'' should look like this<code txt> | ||
+ | .../feather_nrf52840_express | ||
+ | ├── feather_nrf52840_express_bootloader-0.2.1_s140_6.1.1.zip | ||
+ | ├── feather_nrf52840_express_bootloader-0.2.1_s140_6.1.1.hex | ||
+ | ├── feather_nrf52840_express_bootloader-0.3.0_s340_6.1.1.hex | ||
+ | └── feather_nrf52840_express_bootloader-0.3.0_s340_6.1.1.zip | ||
+ | </code> | ||
Now you should be ready to rock. Restart PlatformIO IDE and select ''Adafruit Bluefruit Feather nRF52840 Express w.ANT'' as your board type :) | Now you should be ready to rock. Restart PlatformIO IDE and select ''Adafruit Bluefruit Feather nRF52840 Express w.ANT'' as your board type :) |