IC:

Features

  • On-chip boot ROM

  • Contains the bootloader with In-System Programming (ISP) facility

  • Secure boot process using the Ed25519 Cryptographic Algorithm

  • Suspend resume process for low power

  • Boot from NOR flash

  • PSRAM as a memory

Boot Address

On reset, the processor loads the PC with the value of the reset vector defined in the vector table, which is fixed by hardware. Both KM4 and KM0 boot from address 0x0000_0000.

CPU

Boot address

Type

KM4

0x0000_0000

KM4 ITCM ROM

KM0

0x0000_0000

KM0 ITCM ROM

Pin Description

The SoC supports ISP (In-System Programming) via LOGUART (PB4 / PB5) or USB to download code into Flash. The ISP mode is determined by the state of PB5 when boot.

Boot Mode

PB5 (DOWNLOAD_MODE)

Description

No ISP

HIGH

ISP bypassed. The IC attempts to boot from Flash.

ISP

LOW

The IC enters ISP via LOGUART or USB.

Note

After mass production, a specific eFuse bit can be programmed to permanently disable ISP mode.

Boot Flow

After power-up or hardware reset, the hardware will boot the KM4 core at 150MHz. The boot process is handled by the on-chip Boot ROM and is always executed by the KM4 core.

After executing the KM4 bootloader code, the KM4 will initialize the environment for the KM0 core.

  1. KM4 boots ROM

  2. KM4 ROM checks whether to enter ISP mode

  3. KM4 secure boot, ROM verifies bootloader signature (optional)

  4. KM4 boots to bootloader

  5. KM4 bootloader set the frequency of SoC according to ameba_bootcfg.c

  6. KM4 bootloader establishes the non-secure execution environment according to ameba_boot_trustzonecfg.c if TrustZone is enabled

  7. KM4 bootloader assists KM0 images loading and signature verification (optional)

../../_images/boot_flow_dplus.svg

SoC boot flow

Boot API

The API BOOT_Reason() is used to obtain the cause of chip boot, and the function prototype is:

u32 BOOT_Reason(void);

The return value of this API will be printed via LOGUART, and the default return value is 0 when the chip is initially powered-on. The return value of re-boot caused by other reasons can be found in the following table. Users can find macro-definitions about return value in the file sysreg_aon.h.

Items

Description

Introduction

Get boot reason

Parameter

None

Return

Boot reason. It can be any of the following values or combinations:

  • AON_BIT_RSTF_OCP: Enter deep-sleep mode when OCP happens

  • AON_BIT_RSTF_KM0_SYS: KM0 system reset

  • AON_BIT_RSTF_KM4_SYS: KM4 system reset

  • AON_BIT_RSTF_WDG0: KM0 watchdog reset

  • AON_BIT_RSTF_WDG1: KM4 secure watchdog reset

  • AON_BIT_RSTF_WDG2: KM4 non-secure watchdog reset

  • AON_BIT_RSTF_WARM_KM42PERI: KM4 warm reset

  • AON_BIT_RSTF_WARM_KM02PERI: KM0 warm reset

  • AON_BIT_RSTF_DSLP: Wakeup from deep-sleep mode

  • AON_BIT_RSTF_BOR: BOR Reset