Debug a stack overflow:
Flash or update image:
Since the shell is a C interpreter, you can declare and print variables:
int x = 42; // Declare
char * msg = "Hello"; // Declare string
printVal x; // Print value
printf("Msg: %s\n", msg); // Use stdio functions
| Command | Description |
|---------|-------------|
| msgQShow | Show message queues |
| msgQSend <qId> <msg> <size> <timeout> | Send a message |
| msgQReceive <qId> <buffer> <maxSize> <timeout> | Receive a message | vxworks command cheat sheet
| Command | Description |
|---------|-------------|
| version | Show VxWorks version |
| sysSuspend | Halt system (debug mode) |
| sysResume | Resume from sysSuspend |
| reboot | Reboot the system |
| printError <errno> | Print description of error number |
| errno | Show last error number of current task |
| show <kernelObject> | Generic object info (e.g., show tasks, show semaphores) |
| checkStack | Check stack usage of all tasks |
| spy | Monitor task CPU usage (requires spyLib) |
VxWorks provides dynamic memory pools and heap inspection commands.
malloc, free — Standard allocation functions exist in user code; shell offers mallocShow in some BSPs. Debug a stack overflow:
sysMemTop / memPartInfo — Inspect partitions and region sizes (implementation dependent).
cacheShow / cacheFlush — Inspect and flush CPU caches when working with DMA or memory-mapped I/O.
Best practice: flush caches before handing buffers to DMA; prefer statically allocated buffers where possible in hard real-time paths. Flash or update image:
You are a low-level engineer. You need to peek and poke at physical memory.
| Command | Description | Example |
| :--- | :--- | :--- |
| d | Display (dump) memory in hex and ASCII. | d 0x00100000, 100 (dump 100 bytes) |
| d.b | Display bytes. | d.b 0x80001000 |
| d.w | Display words (2 bytes). | d.w 0x80001000 |
| d.l | Display long words (4 bytes). | d.l 0x80001000 |
| m | Modify memory (interactive). | m 0x80001000 |
| m.b / m.w / m.l | Modify bytes/words/longs. | m.l 0x80001000 0xDEADBEEF |
| fill | Fill a memory region with a value. | fill 0x80000000, 0x100, 0xFF |
| copy | Copy memory region. | copy 0x8000, 0x9000, 0x200 |