Skip to content

Commit 1238ad3

Browse files
committed
Port to Portenta C33 and simplify uniqueID for Renesas platforms
1 parent 2a5425b commit 1238ad3

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

Diff for: src/Arduino_10BASE_T1S.h

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ static int const IRQ_PIN = 2;
4646
static int const CS_PIN = PinNameToIndex(PH_6);
4747
static int const RESET_PIN = PinNameToIndex(PJ_11);
4848
static int const IRQ_PIN = PinNameToIndex(PC_7);
49+
#elif defined(ARDUINO_PORTENTA_C33)
50+
/* Pro Demo kit on MID carrier, UNO form factor */
51+
static int const CS_PIN = 25;
52+
static int const RESET_PIN = 4;
53+
static int const IRQ_PIN = 2;
4954
#else
5055
# error "No pins defined for your board"
5156
#endif

Diff for: src/MacAddress.cpp

+10-18
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,10 @@ void get_unique_chip_id_3(uint8_t * uid)
8282
uint32_t const samd_uid = *(volatile uint32_t*)(0x0080A048);
8383
memcpy(uid, &samd_uid, 3);
8484
}
85-
#elif defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4)
85+
#elif defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_PORTENTA_C33)
8686
{
87-
#define BSP_FEATURE_BSP_MCU_INFO_POINTER_LOCATION (0x407FB19C)
88-
#define BSP_FEATURE_BSP_UNIQUE_ID_OFFSET (0x14)
89-
#define BSP_FEATURE_BSP_UNIQUE_ID_POINTER ((*(uint32_t *) BSP_FEATURE_BSP_MCU_INFO_POINTER_LOCATION) \
90-
+ \
91-
BSP_FEATURE_BSP_UNIQUE_ID_OFFSET)
92-
typedef struct st_bsp_unique_id
93-
{
94-
union
95-
{
96-
uint32_t unique_id_words[4];
97-
uint8_t unique_id_bytes[16];
98-
};
99-
} bsp_unique_id_t;
100-
101-
bsp_unique_id_t const * renesas_unique_id = (bsp_unique_id_t *) BSP_FEATURE_BSP_UNIQUE_ID_POINTER;
102-
memcpy(uid, renesas_unique_id->unique_id_bytes, 3);
87+
const bsp_unique_id_t* t = R_BSP_UniqueIdGet();
88+
memcpy(uid, t->unique_id_bytes, 3);
10389
}
10490
#elif defined(ARDUINO_GIGA) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
10591
{
@@ -113,4 +99,10 @@ void get_unique_chip_id_3(uint8_t * uid)
11399
#else
114100
# error "Retrieving a unique chip ID for MAC generation is not supported on this platform."
115101
#endif
116-
}
102+
}
103+
104+
#if defined(ARDUINO_PORTENTA_C33)
105+
extern "C" int LWIP_RAND() {
106+
return rand();
107+
}
108+
#endif

0 commit comments

Comments
 (0)