28#if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
31#include <crypto/wolfssl/ssl.h>
36 HalStore_Config = 0x01,
38 HalStore_UserParams = 0x03,
40 HalStore_FileSys = 0xFC
45 HALSTORE_NO_ERROR = 0,
46 HALSTORE_ERR_UNKNOWN = -1,
49 HALSTORE_NOTSUPPORTED = -4,
50 HALSTORE_NOTAVAILABLE = -5,
51 HALSTORE_NOTREADY = -6,
70void ForceReboot(
bool bFromException =
false) __attribute__((noreturn));
268#ifdef GATHER_RANDOM_USE_HW
275extern bool HalHWRandRdy(
void);
282extern uint32_t HalGetHWRand32(
void);
311#if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
367uint16_t HalGetDeviceFormat();
int HalStorage_WriteOffset(uint8_t area)
Get the offset of the next byte that can be written in the given persistent storage area.
uint16_t HalGetDeviceCertLen()
Get the length of the stored certificate.
void FlashProgramAppImage(void *pWhere, void *pWhat, int len)
Write an application image to flash memory.
void HalEraseDeviceCertAndKey()
Clear the device certificate and key from persistent storage.
bool HalSaveNewDeviceCert(const uint8_t *cert, uint16_t certlen, uint8_t format=SSL_FILETYPE_PEM)
Save a device certificate in persistent storage.
uint32_t spaceleft()
Report how much free unallocated space is left in dynamic memory.
void DisableCache()
Disable the instruction and data cache.
int HalStorage_GetMaxAllocation(uint8_t area)
Obtain the maximum size that may be allocated to the given persistent storage area....
int HalStorage_Prepare(uint8_t area, int len, int offset=0)
Prepare a storage area for writing new data. For platforms with direct flash mapping this function is...
void EnableCache()
Enable the instruction and data cache.
void FlashErase(void *pWhere, int len)
Erases the flash memory.
int HalStorage_Erase(uint8_t area, int len=-1, int offset=0)
Erase all or part of a storage area. Note: due to physical storage granularities, the total area eras...
bool HalDeviceCertValid()
Determine if the stored certificate is valid.
bool HalSaveNewDeviceKey(const uint8_t *key, uint16_t keylen, uint8_t format=SSL_FILETYPE_PEM)
Save a device key in persistent storage.
void HardwareSetup()
Initializes the system hardware such as the timer, cache and clock speed.
int HalStorage_Save(uint8_t area, void *pData, int len, int offset=0)
Save a blob to a specific persistent storage area as defined by the platform. This routine will perfo...
void(* watchdog_service_function)(void)
Watchdog callback service function.
uint8_t * HalGetDeviceCert()
Get a pointer to the stored certificate.
int HalStorage_Finalize(uint8_t area)
Finalize a storage area after writing new data. This will perform any final completion or cleanup rou...
int HalStorage_GetAllocated(uint8_t area)
Obtain the total size allocated to the given persistent storage area.
void SysLogCheckIntc(void)
This is just like the StdioCheckIntc() function, except that the results are displayed via UDP.
uint16_t HalGetTickFraction(void)
Returns the fraction of the current system time tick.
int HalStorage_SavePartial(uint8_t area, void *pData, int len, int offset)
Save a blob to a specific persistent storage area as defined by the platform. This routine requires t...
void ForceReboot(bool bFromException=false)
Forces the system hardware to perform a soft reset.
int HalStorage_RemainingSpace(uint8_t area)
Obtain the number of remaining bytes available to be written in the given persistent storage area.
uint16_t HalGetDeviceKeyLen()
Get the length of the stored key.
void FlashProgram(void *pWhere, void *pWhat, int len)
Program flash memory.
int HalStorage_AddressOffset(uint8_t area, void *pWhere)
Get the offset within a persistent storage area of an address. A platform may map any address to any ...
uint8_t * HalGetDeviceKey()
Get a pointer to the stored certificate.
uint32_t HalTickMaxCount
Rollover value for the system hardware tick timer.
void StdioCheckIntc(void)
Check STDIO interrupt sources.
void PostConfigHardwareInit()
Initializes the system hardware that depend on config variables such as the watchdog.