1.5.3.1 How the Library Works
- get user-defined parameters
- set user-defined parameters
- set callbacks
The PRIME Stack uses this interface to access the user PIBs when they are requested via MLME, Serial Profile or PRIME Profile by the user.
This library needs to be initialized. On PIC32CXMT devices it does not need to be maintained periodically; on the SAMD20 it must be maintained periodically through SRV_USER_PIB_Tasks (normally called from SYS_Tasks).
This library does not include storage. Users are responsible for adding and storing their own PIBs.
Currently, there are user PIBs related to the reset handling, which are populated by the Reset Handler Service. The available PIBs and where they are stored depend on the device.
PIC32CXMT
On PIC32CXMT devices, the reset-handling PIBs are stored in the GPBRs.
| PIB | ID | Contents |
|---|---|---|
| PIB_USER_RESET_INFO | 0xF000 | number of resets + reset type |
| PIB_USER_PC | 0xF001 | PC |
| PIB_USER_LR | 0xF002 | LR |
| PIB_USER_PSR | 0xF003 | PSR |
| PIB_USER_HFSR | 0xF004 | HFSR |
| PIB_USER_CFSR | 0xF005 | CFSR |
| PIB_USER_R0 | 0xF006 | R0 |
| PIB_USER_R1 | 0xF007 | R1 |
| PIB_USER_R2 | 0xF008 | R2 |
| PIB_USER_R3 | 0xF009 | R3 |
| PIB_USER_R12 | 0xF00A | R12 |
SAMD20
On the SAMD20, the user PIBs are stored in the emulated EEPROM. They comprise the reset-handling PIBs populated by the Reset Handler service and a bootloader-control PIB that requests the Bootloader Serial Recovery mode, as listed in the following table:
| PIB | ID | Contents |
|---|---|---|
| PIB_USER_RESET_INFO | 0xF000 | number of resets + reset type |
| PIB_USER_PC | 0xF001 | PC |
| PIB_USER_LR | 0xF002 | LR |
| PIB_USER_PSR | 0xF003 | PSR |
| PIB_USER_R0 | 0xF006 | R0 |
| PIB_USER_R1 | 0xF007 | R1 |
| PIB_USER_R2 | 0xF008 | R2 |
| PIB_USER_R3 | 0xF009 | R3 |
| PIB_USER_R12 | 0xF00A | R12 |
| PIB_USER_BOOTLOADER_UART_MODE | 0xF010 | request the Bootloader Serial Recovery mode |
