Search code examples
portingcortex-msoczephyr-rtos

Zephyr Porting to an SoC based on already supported CPU


Is there any video or pdf tutorial which shows step by step guide on how to do Zephyr porting to a new SoC. I know there is a page on Zephyr website, https://docs.zephyrproject.org/latest/hardware/porting/arch.html#architecture-porting-guide but this does not give me detailed view of what files to create where and what should be their content etc.

Any reference to such a guide will be very nice. Thanks a lot in advance.


Solution

  • Video or PDF - probably no. Sources of Zephyr speaks for itself.

    According to tags you have Cortex-M based SoC. So Architecture Porting Guide is not for you.

    First of all you shold understand what is Devicetree. There is whole folder of DTs of ARM based SoCs. Take several for reference.

    Next step. Is there drivers for peripherals of your SoC? If no, you should write drivers. For reference take a look at drivers folder. While driver development you shold think about DT and use DT related macroses. If you already have HAL, you just need to write glue code.

    You should "connect" driver code and Devicetree of SoC: use bindings.

    SoC needs linker script and maybe SoC related initialization code. For references look at soc folder.

    Now you have Zephyr for your SoC!

    In the end you get on board level. Write dts for SoC featured board. Examples here.