This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:development:kbi [2022/08/08 07:07] ruby [Introduction] |
products:sbc:common:development:kbi [2026/02/02 00:44] (current) gray update by using AI |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== KBI - Khadas Bootloader Instructions ====== | ====== KBI - Khadas Bootloader Instructions ====== | ||
| - | ===== Introduction ===== | + | This page introduces KBI. You will learn how to manage the status of a Khadas SBC through KBI. |
| - | + | ||
| - | This page introduces | + | |
| <WRAP important > | <WRAP important > | ||
| - | KBI is an abbreviation for Khadas Bootloader Instructions, which aims to fulfill the following purposes: | + | Khadas Bootloader Instructions |
| - | * Manage the programmable MCU | + | * Manage the programmable MCU. |
| - | * Carry out low level hardware management | + | * Perform |
| - | * Let developers | + | * Enable |
| - | </ | + | |
| <WRAP info > | <WRAP info > | ||
| - | This page takes VIM2 as an example, other SBCs are similar. | + | This page uses VIM2 as an example. |
| </ | </ | ||
| - | ==== Get help ==== | + | ===== Uboot usage ===== |
| - | Before continuing, make sure you have booted into U-Boot: | + | To get started, ensure |
| ```shell | ```shell | ||
| Line 24: | Line 21: | ||
| boot wol: enable | boot wol: enable | ||
| Hit Enter or space or Ctrl+C key to stop autoboot -- : 0 | Hit Enter or space or Ctrl+C key to stop autoboot -- : 0 | ||
| - | kvim2# | + | kvim2# |
| ``` | ``` | ||
| + | |||
| + | ==== Help information ===== | ||
| You can get help information by typing '' | You can get help information by typing '' | ||
| Line 53: | Line 52: | ||
| ``` | ``` | ||
| - | ==== KBI Command ==== | + | ==== MCU Verison |
| - | + | ||
| - | === MCU Verison === | + | |
| Get the MCU firmware version: | Get the MCU firmware version: | ||
| Line 64: | Line 61: | ||
| ``` | ``` | ||
| - | === Initialize === | + | ==== Initialize |
| Initialize the KBI: | Initialize the KBI: | ||
| Line 72: | Line 69: | ||
| ``` | ``` | ||
| - | === Serial number === | + | ==== Serial number |
| Get the device serial number: | Get the device serial number: | ||
| Line 81: | Line 78: | ||
| ``` | ``` | ||
| - | === ADC === | + | ==== ADC ==== |
| Get ADC value: | Get ADC value: | ||
| Line 89: | Line 86: | ||
| ``` | ``` | ||
| - | The ADC value can be used to distinguish different hardware modules. | + | The ADC value can be used to distinguish |
| - | === Power Off === | + | ==== Power Off ==== |
| - | Power off device: | + | Power off the device: |
| ```shell | ```shell | ||
| kvim2# kbi poweroff | kvim2# kbi poweroff | ||
| ``` | ``` | ||
| - | === MAC Address === | + | ==== MAC Address |
| Get the Ethernet MAC address: | Get the Ethernet MAC address: | ||
| Line 106: | Line 103: | ||
| ``` | ``` | ||
| - | === LED Control === | + | ==== LED Control |
| - | Setup the blue LED: | + | The blue LED has four operating modes: '' |
| - | The blue LED has different working modes: '' | + | The MCU, which handles system power management, controls the blue LED. The CPU controls the white LED. |
| + | Therefore, the blue LED continues to function even when the VIM2 is powered off. | ||
| - | The blue LED is controlled by the MCU, and the MCU is in charge of system power management. The white LED is controlled by the CPU; therefore | + | KBI can be used to program |
| - | The KBI can be used to program the blue LED for two different | + | * system off / idle: Power-off |
| + | * system on / working: Power-on status, the CPU is in working mode. | ||
| - | * system off / idle: power off status, the CPU is powered down. | + | Example: |
| - | * system on / working: power on status, the CPU is in working mode. | + | |
| - | + | ||
| - | Examples: | + | |
| To check the blue LED’s setting for '' | To check the blue LED’s setting for '' | ||
| Line 128: | Line 124: | ||
| ``` | ``` | ||
| - | To check the blue LED’s setting for '' | + | Check the blue LED setting for '' |
| ```shell | ```shell | ||
| Line 134: | Line 130: | ||
| led mode: off [systemon] | led mode: off [systemon] | ||
| ``` | ``` | ||
| + | When the VIM2 is powered on, the blue LED is set to '' | ||
| - | The terminal printout above says that the blue LED is to remain '' | + | You can reset it to '' |
| ```shell | ```shell | ||
| kvim2# kbi led systemon w breathe | kvim2# kbi led systemon w breathe | ||
| Line 147: | Line 143: | ||
| ``` | ``` | ||
| - | === Boot Mode === | + | ==== Boot Mode ==== |
| - | VIM2 comes with both SPI flash and eMMC Storage. The KBI can be used to setup one of these as the default boot media. | + | You can flash images to either |
| - | + | ||
| - | To set the default boot media as SPI flash: | + | |
| + | Set the default boot media to SPI flash: | ||
| ```shell | ```shell | ||
| kvim2# kbi bootmode w spi | kvim2# kbi bootmode w spi | ||
| ``` | ``` | ||
| - | To set the default boot media as eMMC storage: | + | Set default boot media to eMMC storage: |
| ```shell | ```shell | ||
| Line 163: | Line 158: | ||
| ``` | ``` | ||
| - | You can check the default boot media by running: | + | You can check the current |
| ```shell | ```shell | ||
| Line 170: | Line 165: | ||
| ``` | ``` | ||
| - | === Boot Trigger Events === | + | ==== Boot Trigger Events |
| - | VIM2 supports | + | The VIM2 supports |
| - | * WOL: Wake on Lan | + | * WOL: Wake-on-Lan |
| * RTC: RTC timer | * RTC: RTC timer | ||
| * IR: IR remote controller | * IR: IR remote controller | ||
| Line 179: | Line 174: | ||
| * Key: Power Key/Button | * Key: Power Key/Button | ||
| * GPIO: External GPIO events | * GPIO: External GPIO events | ||
| - | This means that when your VIM2 is powered-off, | + | This means any of the above events can trigger |
| - | Examples: | + | For example: |
| - | * Get the status | + | * Get the status |
| + | ```shell | ||
| kvim2# kbi trigger wol r | kvim2# kbi trigger wol r | ||
| boot wol: disable | boot wol: disable | ||
| ``` | ``` | ||
| - | * By default, | + | * WOL is disabled |
| + | ```shell | ||
| kvim2# kbi trigger wol w 1 | kvim2# kbi trigger wol w 1 | ||
| set_wol: 1 | set_wol: 1 | ||
| ``` | ``` | ||
| - | * Of course, for security reasons, you might want to disable | + | * For security reasons, you may want to disable WOL: reasons. : |
| + | ```shell | ||
| kvim2# kbi trigger wol w 0 | kvim2# kbi trigger wol w 0 | ||
| set_wol: 0 | set_wol: 0 | ||
| ``` | ``` | ||
| - | ===== See Also ===== | + | ====== Read for reference ====== |
| - | * [[https://dl.khadas.com/Hardware/Edge/MCU/Edge-V_MCU_REG_EN.pdf|Edge-V MCU Register Map]] | + | * [[dl> |
| - | * [[https://dl.khadas.com/Hardware/VIM2/MCU/VIM2_MCU_REG_EN.pdf|VIM2 MCU Register Map]] | + | * [[dl> |
| - | * [[https://dl.khadas.com/Hardware/VIM3/MCU/VIM3_MCU_REG_EN.pdf|VIM3 MCU Register Map]] | + | * [[dl> |