Skip to content

Hook function before main() and after RTOS initialisation #6034

@RobMeades

Description

@RobMeades

Description

The UBLOX_C030 series targets require that a voltage level in a chip on the board is configured during boot for reliable operation. This configuration has to be performed over I2C. The [ST standard] I2C drivers used on this target make calls to wait_us() during I2C read and write requests; this is a sensible thing to do since the RTOS can run other tasks while waiting. However, since wait_us() is an RTOS call, this means that the I2C [HAL] API cannot be called from HAL_MspInit(), the target configuration hook function, as the RTOS is not initialised at that point.

Hence we need a hook that can be used by target code after RTOS initialisation. I think that this will be a generally useful feature to have as there will be other cases where targets need configuration of items that are not as simple as a register.

FYI, we proposed using mbed_main() for this purpose in #6023 but we now understand that this is for user code and not for target code.

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