AnsweredAssumed Answered

STM32 uClinux: using SNMP for remote management of embedded device

Question asked by khusainov.vladimir on Feb 2, 2012
Latest reply on Feb 6, 2012 by lightning
Here is a sample session showing some basic uses of SNMP for remote management of an STM32-based device. This session was run under uClinux on an STM322G-EVAL board with Emraft's STM-MEM add-on. (Refer to for further information on that platform.)

After reset, U-boot comes on from embedded Flash and proceeds to boot uClinux onto the board:
U-Boot 2010.03-linux-cortexm-1.3.1 (Jan 17 2012 - 16:51:54) 
CPU  : STM32 F2 series (Cortex-M3) 
Freqs: SYSCLK=120MHz,HCLK=120MHz,PCLK1=30MHz,PCLK2=60MHz 
Board: STM3220G-EVAL board 1 
DRAM:  32 MB 
Flash:  8 MB 
## Booting kernel from Legacy Image at 60020000 ... ...
Linux version 2.6.33-arm1 ( (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-188) ) #1 Tue Jan 17 17:28:16 MSK 2012 ..
init started: BusyBox v1.17.0 (2012-01-17 17:26:56 MSK) ~ #  
From the shell prompt, I start an SNMP agent:
~ # snmpd -C -c /etc/snmpd.conf -Le -fNET-SNMP version 5.6.1 
Now, I am able to query my STM32 device remotely using standard SNMP tools. For instance,  here is how this is done from a Linux PC box:
[psl@pvr ~]$ snmpget -v1 -c public . 
SNMPv2-MIB::sysDescr.0 = STRING: Linux stm3220g-eval 2.6.33-arm1 #139 Thu Feb 2 14:19:32 MSK 2012 armv7ml 
[psl@pvr ~]$  
Back to the target, and here is how I send a trap event to remote management tools:
~ # snmptrap -v 1 -c public '' '' 6 99 '55' s "I'm here" 
When I check SNMP traps at the host, the trap from STM32 is reported as appropriate:
[root@pvr ~]# snmptrapd -C -c /home/work/psl/SF/release/snmptrapd.conf -Le -fNET-SNMP version 5.5 
2012-02-02 13:52:55 UDP: []:53140->[]) TRAP, SNMP v1, community public 
     iso. Enterprise Specific Trap (99) Uptime: 0:00:00.55 
     iso. = STRING: "I'm here"