Commit f85b638
committed
Fix mbed-os-to-arduino for PortentaH7
dtcm section added too; can be used with
int testdtcm __attribute__((section (".dtcm"))) = 42;
/* copy *dtcm from flash to DTCM */
extern uintptr_t _dtcm_lma;
extern uintptr_t _sdtcm;
extern uintptr_t _edtcm;
volatile uint8_t *dst = (volatile uint8_t *)&_sdtcm;
volatile uint8_t *src = (volatile uint8_t *)&_dtcm_lma;
while ((uintptr_t)dst < (uintptr_t)&_edtcm) {
*dst++ = *src++;
}
Serial.println(testdtcm); // will print 42
Serial.println((uintptr_t)&testdtcm, HEX); // will print somethin in rang 0x200000001 parent 4cf572f commit f85b638
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
202 | 208 | | |
203 | 209 | | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
207 | 213 | | |
208 | | - | |
209 | | - | |
| 214 | + | |
| 215 | + | |
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
| |||
0 commit comments