platformio / platform-nordicnrf51

Nordic nRF51: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/nordicnrf51
Apache License 2.0
20 stars 25 forks source link

unable to specify custom board json in project_dir #12

Closed zerog2k closed 6 years ago

zerog2k commented 6 years ago

following instructions here, http://docs.platformio.org/en/latest/platforms/creating_board.html trying to create a project-specific custom board json, e.g boards/rcqr01.json

{
  "build": {
    "cpu": "cortex-m0", 
    "f_cpu": "16000000L", 
    "mcu": "nrf51822"
  },
  "connectivity": [
    "bluetooth"
  ],
  "frameworks": [
    "mbed"
  ], 
  "name": "rcqr01", 
  "upload": {
    "maximum_ram_size": 16384, 
    "maximum_size": 262144
  }, 
  "url": "", 
  "vendor": "Turning Technologies"
}

however, this alone simply does not appear to be enough. Seems mbed framework may require more than this, as I get this when building:

> Executing task: platformio run <

[Tue Aug  1 23:28:48 2017] Processing nrf51_rcqr01 (platform: nordicnrf51; lib_deps: ble-nrf51822; extra_scripts: custom_uploader.py; board: rcqr01; framework: mbed)
----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Cannot find the configuration file for your board! Please read instructions here /Users/jens/.platformio/packages/framework-mbed/platformio/README.txt
============================================================ [ERROR] Took 0.37 seconds ============================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

I can use the bbcmicrobit (as it has same 16k memory as my board), but I wanted to customize to my board, and be able to keep it with the project dir in the repo. Looking into .platformio/packages/framework-mbed/platformio/, i see there are a ton of VARIANTS which seem to have some mbed specific configuration, e.g. microbit: NRF51_MICROBIT/mbed_config.h & NRF51_MICROBIT/NRF51_MICROBIT.json

maybe this is some microbit limitation? is there any way to "extend" an existing board definition, or any way to expose the lower-level mbed configuration at project-level control (again, so it can be captured and distributed with repo)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/47840056-unable-to-specify-custom-board-json-in-project_dir?utm_campaign=plugin&utm_content=tracker%2F38217987&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38217987&utm_medium=issues&utm_source=github).
ivankravets commented 6 years ago

mbed depends on a specific target name which it uses among soure code. If you have a custom board which is compatible with existing mbed's target, you map it in ~/.platformio/packages/framework-mbed/platformio/variants_remap.json