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 loadslinkscan_led_fw.binat offset0x0and the board’scustom_led.binat0x3800(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 unloadandm0 loadon 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,statsandlogare 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 RunningorNOT Running), its version, image size and CRC, and the version the SDK expects (Host FW Version). Mismatches are flagged withM0FW CRC do not match load CRCandHost and M0 FW Versions do not match!!!. Then, for each core whose firmware reports a version,uC <n> status: Okand aversion: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 failon error. See the warning above.Unvalidated
drivshell> m0 stop 0
- M0 start <uCnum>
Release one core from reset. Prints
M0 start failon error.Unvalidated
drivshell> m0 start 0
- M0 unload <uCnum>
Reset one core and unload its firmware. Prints
M0 uC: <n> unload failedon 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 or0xhex). 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 printsLoading 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 …printsCoresGroup 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 nameFurther reading
sonic-buildimage issues with bcmcmd usage (exemplars #1762, #3212, #10733, #22287, #28832).