Is it possible to use the same resource(e.g GPIO) on each core (HL/RT core)?

ivan 100 Reputation points
2023-04-25T02:00:22.61+00:00

Hello, regarding the resource of app_manifest.json, I wonder if I can use the same hardware resource on each core (HL/RT core) with different IDs(e.g GPIO 8/ GPIO9)? I mean that if there is an app__manifest.json of HL core and app__manifest.json of RT core as below and RT core / HL core runs at the same time. Can I control each GPIO from HL/RT core?

# app_manifest.json of HL core

  "Capabilities": {
    "Gpio": [ "$TEMPLATE_LED" ]       # << Actual GPIO ID of TEMPLATE_LED is GPIO 8
  },
# app_manifest.json of RT core

  "Capabilities": {
    "Gpio": [ 9 ]                     # << Actual GPIO ID is GPIO 9
  },

Thanks.

Azure Sphere
Azure Sphere
An Azure internet of things security solution including hardware, operating system, and cloud components.
163 questions
{count} votes

Accepted answer
  1. James Devine 165 Reputation points Microsoft Employee
    2023-04-27T18:04:57.8666667+00:00

    Hiya!

    GPIO's are allocated per core in blocks of 4. A block cannot be split across cores. This is roughly described in the documentation. We will update the documentation to provide greater clarity on this point.

    You might find this VS Code extension, written by UCL, helpful for peripheral allocation in an application manifest.

    In your specific example, GPIO8 and GPIO9 belong to the same GPIO block and therefore cannot be shared between cores.

    Again GPIO blocks contain 4 GPIO. Blocks 0, 1, and 2 also double as PWM0, PWM1, PWM2. If PWM0, PWM1, PWM2 are allocated to core, the pins belonging to the respective block should be considered allocated. GPIO blocks are allocated as follows and a block cannot be split across cores.

    GPIO Block GPIOs
    0 GPIO0, GPIO1, GPIO2, GPIO3
    1 GPIO4, GPIO5, GPIO6, GPIO7
    2 GPIO8, GPIO9, GPIO10, GPIO11
    3 GPIO12, GPIO13, GPIO14, GPIO15
    4 GPIO16, GPIO17, GPIO18, GPIO19
    5 GPIO20, GPI21, GPIO22, GPIO23

    ISU GPIO are allocated in blocks of 5 and a block cannot be split across cores:

    ISU GPIOs
    0 GPIO26, GPIO27, GPIO28, GPIO29, GPIO30
    1 GPIO31, GPIO32, GPIO33, GPIO34, GPIO35
    2 GPIO36, GPIO37, GPIO38, GPIO39, GPIO40
    3 GPIO66, GPIO67, GPIO68, GPIO69, GPIO70
    4 GPIO71, GPIO72, GPIO73, GPIO74, GPIO75

    I2S GPIO are also allocated in blocks of 5 and a block cannot be split across cores:

    I2S GPIOs
    0 GPIO56, GPIO57, GPIO58, GPIO59, GPIO60
    1 GPIO61, GPIO62, GPIO63, GPIO64, GPIO65

    ADC GPIO are allocated as a single block of 8. The 8 pins can only be used by one core:

    ADC GPIOs
    0 GPIO41, GPIO42, GPIO43, GPIO44, GPIO45, GPIO46, GPIO47, GPIO48
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful