DocID024383 Rev 1
35/56
UM1619
Firmware description
6.6.2 Ping
Frames
This particular frame is used to ping a remote (via PLM interface) or a local (via COMM
interface) module. When a ping frame is received, this is managed directly at data link layer
and is not notified at the application and consequently at the user levels.
From the COMM interface module (SPI, USART, USB, etc.)
buffer[0] = 10;
// Ping frame payload length (n + 11)
buffer[1] = APP_PING_FRAME;
// Ping frame type
buffer[2,3] = target_module.group;
// Target device group (2 bytes)
buffer[4,5,6,7] = target_module.address;
// Target device address (4 bytes)
buffer[8,9] = CRC16;
// CRC-16
From / to communication interface (PLM, SPI, USART, USB, etc.)
frame.source = SOURCE_PLM / ...;
// Data source PLM, ...
frame.type = APP_PING_FRAME;
// Ping frame type
frame.len = 0;
// Ping frame payload length
frame.broadcast = FALSE;
// Ping frames can be sent only in unicast
frame.group = target_module.group;
// Target device group (2 bytes)
frame.address = target_module.address;
// Target device address (4 bytes)
6.6.3 Error
Frames
These can be considered data frames; they are user error frames from user application level
addressed to a target PLM module.
From the COMM interface module (SPI, USART, USB, etc.)
uint8_t *buffer;
buffer[0] = 12;
// Error frame payload length (12)
buffer[1] = APP_ERROR_FRAME;
// Data frame type
buffer[2,3] = target_module.group;
// Target device group (2 bytes)
buffer[4,5,6,7] = target_module.address;
// Target device address (4 bytes)
buffer[8,9] = user_error_code;
// User error code (2 bytes)
buffer[10,11] = CRC16;
// CRC-16
From / to communication interface (PLM, SPI, USART, USB, etc.)
APP_userdata_t frame;
frame.source = SOURCE_PLM / ...;
// Data source PLM, ...
frame.type = APP_ERROR_FRAME;
// Error frame type
frame.len = 2;
// Error frame payload length
frame.broadcast = FALSE;
// Error frames are sent in unicast
frame.group = target_module.group;
// Target device group (2 bytes)
frame.address = target_module.address;
// Target device address (4 bytes)
frame.data[0,1] = user_error_code;
// User error code (2 bytes)
Error code list
0x00 = APP_ERROR_
0x01 = APP_ERROR_GENERIC
0x02 = APP_ERROR_COMM_TIMEOUT
0x03 = APP_ERROR_SERVICE_GRP_UNKNOWN
0x04 = APP_ERROR_SERVICE_CMD_ERROR
0x05 = APP_ERROR_COMMUNICATION
0x06 = APP_ERROR_ISOLATED_NODE
0x07 = APP_ERROR_HARDWARE
0x08 = APP_ERROR_WRONG_PROG_COMMAND
0x09 = APP_ERROR_WRONG_PROG_GROUP
0x0a = APP_ERROR_DEVICE_BLANK
0x0b = APP_ERROR_RTC_ERROR
0x0c = APP_ERROR_WATCHDOG_DISABLED
0x0d = APP_ERROR_NODE_INIT_FAILED
0x0e = APP_ERROR_RTC_DISABLED