Skip to content

Commit fdafb3a

Browse files
committed
RP2040: enable entropy source
Fixes #437
1 parent 9eeba8d commit fdafb3a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

variants/NANO_RP2040_CONNECT/conf/mbed_app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"target_overrides": {
33
"*": {
44
"target.printf_lib": "std",
5+
"target.macros_add": [ "MBEDTLS_ENTROPY_NV_SEED" ],
56
"platform.stdio-buffered-serial": false,
67
"platform.stdio-baud-rate": 115200,
78
"platform.default-serial-baud-rate": 115200,

variants/NANO_RP2040_CONNECT/variant.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,16 @@ void _ontouch1200bps_() {
9494
reset_usb_boot(1 << digitalPinToPinName(LED_BUILTIN), 0);
9595
}
9696

97+
// Provide stubs for mbedtls entropy source
98+
// The functions may be implemented using ECCx06 crypto chip
99+
extern "C" {
100+
WEAK int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len ) {
101+
return -1;
102+
}
103+
104+
WEAK int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len ) {
105+
return -1;
106+
}
107+
}
108+
97109
#endif

0 commit comments

Comments
 (0)