Skip to content

nRF52832 custom target and peripheral initialization problems #10562

Closed
@cederom

Description

@cederom

Hello world,

I have created a custom target for my design in custom_targets.json accoring to [1]. The goal is to have common firmware repository and code for different product variants / targets based on very similar hardware.

The problem is some pins seems to be somehow already used/declared/initialized for peripherals that I am not using. For instance GPIO that I use as input is always LOW. I cannot use some pins as IRQ inputs, ADC does not show correct values, etc.

Question: How to create a target that will not have peripherals initialized or anything done in the background? I just want to select peripherals and initialize them myself..

Any hints or references appreciated :-)

[1] https://os.mbed.com/docs/mbed-os/v5.8/tools/adding-and-configuring-targets.html

Below is my custom_targets.json:

{
     "my_first_target" : {
         "inherits": ["MCU_NRF52832"],
         "release_versions": ["5"],
         "device_name": "nRF52832_xxAA"
     },
     "my_second_target" : {
         "inherits": ["MCU_NRF52832"],
         "release_versions": ["5"],
         "device_name": "nRF52832_xxAA"
     },
     "MCU_NRF52832": {
         "inherits": ["Target"],
         "core": "Cortex-M4F",
         "macros": [
             "BOARD_PCA10040",
             "NRF52",
             "TARGET_NRF52832",
             "CMSIS_VECTAB_VIRTUAL",
             "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\"",
             "MBED_TICKLESS"
         ],
         "device_has": [
             "ANALOGIN",
             "FLASH",
             "I2C",
             "I2C_ASYNCH",
             "INTERRUPTIN",
             "ITM",
             "LPTICKER",
             "PORTIN",
             "PORTINOUT",
             "PORTOUT",
             "PWMOUT",
             "SERIAL",
             "SERIAL_ASYNCH",
             "SERIAL_FC",
             "SLEEP",
             "SPI",
             "SPI_ASYNCH",
             "STCLK_OFF_DURING_SLEEP",
             "TRNG",
             "USTICKER"
         ],
        "extra_labels": [
             "NORDIC",
             "NRF5x",
             "NRF52",
             "SDK_14_2",
             "SOFTDEVICE_COMMON",
             "SOFTDEVICE_S132_FULL"
         ],
         "config": {
             "lf_clock_src": {
                 "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC",
                 "help": "Select Low Frequency clock source. Options: NRF_LF_SRC_XTAL, NRF_LF_SRC_SYNTH, and NRF_LF_SRC_RC",
                 "value": "NRF_LF_SRC_XTAL"
             },
             "lf_clock_rc_calib_timer_interval": {
                 "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL",
                 "value": 16
             },
             "lf_clock_rc_calib_mode_config": {
                 "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG",
                 "value": 0
             }
         },
         "OUTPUT_EXT": "hex",
         "is_disk_virtual": true,
         "supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
         "public": false,
         "detect_code": ["1101"],
         "program_cycle_s": 6,
         "bootloader_supported": true
     }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions