M0

M0 commands for led/linkscan fw

M0

Manage the Cortex-M0 cores of the switch’s CPU management interface (cores 0–3). On Trident 3 under SONiC, core 0 runs the link-scan and LED firmware: at startup SONiC loads linkscan_led_fw.bin at offset 0x0 and the board’s custom_led.bin at 0x3800 (led.md (SONiC on Broadcom: LED debugging)). Link up/down detection depends on this firmware.

Sub-command words ignore case but cannot be abbreviated. Core numbers must be integers from 0 to 3; anything else prints Invalid uCnum number: <n>, must be in the range 0 to 3.

Warning

m0 stop, m0 unload and m0 load on core 0 stop or replace the link-scan firmware. SONiC then no longer sees link changes and the LEDs stop working until syncd is restarted. Do not use them on a production switch. status, stats and log are read-only.

Hardware-validated

drivshell> m0 status
M0 FW is Running
M0 FW Version is 1.16, FW size is 13704, crc=0xf2beb6dd
Host FW Version is 1.16 (f2beb6dd)
M0 status

Show whether the link-scan firmware is running (M0 FW is Running or NOT Running), its version, image size and CRC, and the version the SDK expects (Host FW Version). Mismatches are flagged with M0FW CRC do not match load CRC and Host and M0 FW Versions do not match!!!. Then, for each core whose firmware reports a version, uC <n> status: Ok and a version: line. On a SONiC Trident 3 switch only the first three lines appear: the firmware is running, version 1.16, and the CRCs match. Read-only.

Hardware-validated

drivshell> m0 status
M0 FW is Running
M0 FW Version is 1.16, FW size is 13704, crc=0xf2beb6dd
Host FW Version is 1.16 (f2beb6dd)
M0 stats

Print the M0 message and interrupt counters: M0: msg=<n> resp=<n> intr_resp=<n> intr=<n>, the total of software-programmable interrupts, and the count per core (u0–u3). Read-only.

Hardware-validated

drivshell> m0 stats
M0: msg=3 resp=3 intr_resp=0 intr=0
Uc sw programmable total intr=0
M0 sw programmable intr: u0=0 u1=0 u2=0 u3=0
M0 log

Print the M0 firmware log. Prints M0 log is not available. if the firmware keeps none. The log is a fixed-size buffer, so the first line is often cut off at the start. Read-only.

On a SONiC Trident 3 switch the log is full of one repeated line, ../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!! (about 95 lines), from the LED part of the firmware. Link-scan still works with these messages present.

Hardware-validated

drivshell> m0 log
pps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
../../src/apps/led/family/iproc14_led_drv.c:101 Error: Error in led_accu status done!!
...
M0 stop <uCnum>

Hold one core in reset. Prints M0 stop fail on error. See the warning above.

Unvalidated

drivshell> m0 stop 0
M0 start <uCnum>

Release one core from reset. Prints M0 start fail on error.

Unvalidated

drivshell> m0 start 0
M0 unload <uCnum>

Reset one core and unload its firmware. Prints M0 uC: <n> unload failed on error. See the warning above.

Unvalidated

drivshell> m0 unload 0
M0 load <uCnum> <offset> <file>

Load a binary file into the M0 memory of a core at <offset> (decimal or 0x hex). The file name may be up to 256 characters. If the file is not found as given, the shell also looks for it under ../../rc/cmicfw/, ../rc/cmicfw, rc/cmicfw/, cmicfw/, ../../../rc/cmicfw/ and ../../../../rc/cmicfw/ relative to syncd’s working directory. It prints Loading M0 Firmware located at <path> and, on success, Firmware download successed (0x<crc>). (sic). See the warning above.

The CoresGroup (cg) form of newer devices is not supported here: m0 load cg … prints CoresGroup is not supported for old devices.

Unvalidated

drivshell> m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin

Built-in help

Parameters: <command> [<ucore>] [<address>] [<file>]
    command    = [load/unload/status/stats/start/stop/log]
    ucore      = Cortex-M0 ucore number to be loaded.
    address    = offset of shared SRAM to load binary file
    file       = binary file name

Further reading

sonic-buildimage issues with bcmcmd usage (exemplars #1762, #3212, #10733, #22287, #28832).