Debugging commands

The unit implements a virtual com port that can be used for debugging. The following commands are supported:

about

Returns the firmware version of the system

info

Returns a list of assets with name, length and type

scene

Returns information about the active scene e.g. number of allocate objects.

cpu_load

Returns CPU load the Cortex-M4 in percent. 0 -> no load , 100 -> max load

read [addr] [length]

Reads from the external flash memory, starting at address [addr] until [length] bytes have been read. Note that only external flash can be read

erase [block]

Erase a sector in the external memory at address [block].

enter

Enter binary mode and enter upload mode

upload

System ready to accept 256 bytes in binary mode. Will timeout after 2 seconds if no binary data is received. The data sent will be temporary stored in the upload buffer.

view

Displays the content of the upload buffer (256 bytes).

write [address]

Writes the upload buffer to the external memory at address [address]

exit

Exit the binary mode and returns to main menu.

Example:

about
HandConsole
(c)2021 AIVA Robotics
Version: 1.0
[OK]
scene
Update function: 0xffffffff
Background color: 0xffff
Objects: 0x3
Sprite 0x38002130
Text 0x38002174
Text 0x380021b8
[OK]
read 0 200
00000000 44 33 22 11 d8 12 00 00 00 00 00 00 00 00 00 00 D3"………….
00000010 00 00 00 00 9c 12 00 00 3c 00 00 00 00 00 00 00 ……..<…….
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
00000030 00 00 00 00 00 00 00 00 00 00 00 00 74 02 00 00 …………t…
00000040 6d 61 69 6e 00 20 20 20 20 20 20 20 20 20 20 20 main.
00000050 20 20 20 20 00 00 00 00 52 02 00 00 53 63 65 6e ….R…Scen
00000060 65 2e 69 6e 69 74 28 29 0d 0a 53 63 65 6e 65 2e e.init()..Scene.
00000070 73 65 74 5f 63 6f 6c 6f 72 28 30 78 66 66 66 66 set_color(0xffff
00000080 29 0d 0a 70 6c 61 79 65 72 20 3d 20 53 70 72 69 )..player = Spri
00000090 74 65 2e 6e 65 77 28 41 73 73 65 74 73 2e 67 65 te.new(Assets.ge
000000a0 74 28 22 70 6c 61 79 65 72 22 29 2c 20 33 30 2c t("player"), 30,
000000b0 20 32 30 29 0d 0a 74 65 78 74 20 3d 20 54 65 78 20)..text = Tex
000000c0 74 2e 6e 65 77 28 31 32 2c 20 30 78 30 30 30 30 t.new(12, 0x0000
000000d0 2c 20 36 34 2c 36 34 2c 20 22 54 45 53 54 31 22 , 64,64, "TEST1"
000000e0 29 0d 0a 74 65 78 74 3a 73 65 74 5f 61 6c 69 67 )..text:set_alig
000000f0 6e 6d 65 6e 74 28 22 63 65 6e 74 65 72 22 2c 20 nment("center",
00000100 22 6d 69 64 64 6c 65 22 29 0d 0a 74 65 78 74 32 "middle")..text2
00000110 20 3d 20 54 65 78 74 2e 6e 65 77 28 31 32 2c 20 = Text.new(12,
00000120 30 78 30 30 30 30 2c 20 36 34 2c 36 34 2c 20 22 0x0000, 64,64, "
00000130 54 45 53 54 32 22 29 0d 0a 74 65 78 74 32 3a 73 TEST2")..text2:s
00000140 65 74 5f 61 6c 69 67 6e 6d 65 6e 74 28 22 72 69 et_alignment("ri
00000150 67 68 74 22 2c 20 22 62 6f 74 74 6f 6d 22 29 0d ght", "bottom").
00000160 0a 73 70 65 65 64 20 3d 20 35 30 0d 0a 0d 0a 70 .speed = 50….p
00000170 6c 61 79 65 72 3a 73 65 74 5f 75 70 64 61 74 65 layer:set_update
00000180 28 66 75 6e 63 74 69 6f 6e 28 64 65 6c 74 61 29 (function(delta)
00000190 20 0d 0a 20 20 69 66 20 47 61 6d 65 70 61 64 2e .. if Gamepad.
000001a0 69 73 5f 6c 65 66 74 5f 70 72 65 73 73 65 64 28 is_left_pressed(
000001b0 29 20 74 68 65 6e 20 70 6c 61 79 65 72 3a 6d 6f ) then player:mo
000001c0 76 65 28 2d 73 70 65 65 64 2a 64 65 6c 74 61 2c ve(-speed*delta,
000001d0 30 29 20 65 6e 64 0d 0a 20 20 69 66 20 47 61 6d 0) end.. if Gam
000001e0 65 70 61 64 2e 69 73 5f 72 69 67 68 74 5f 70 72 epad.is_right_pr
000001f0 65 73 73 65 64 28 29 20 74 68 65 6e 20 70 6c 61 essed() then pla
[OK]