Skip to content

Commit 5d4541e

Browse files
committed
Aligned databuffer to 32-bit address
__attribute__((__aligned__(4))) uint8_t databuffer[1023]; //__attribute__((__section__(".bss_hram0"))) /*SAMD21 datasheet p804: Bits 31:0 – ADDR[31:0]: Data Pointer Address Value These bits define the data pointer address as an absolute word address in RAM.The two least significant bits must be zero to ensure the start address is 32-bit aligned.*/
1 parent d695e8c commit 5d4541e

File tree

4 files changed

+10
-2295
lines changed

4 files changed

+10
-2295
lines changed

MKR1010_USBIso_Core_v1/CDCIso.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ class CDCIso_ : public PluggableUSBModule {
3737

3838
uint8_t writebuffer[1023];
3939
uint8_t lenwritebuffer;
40-
uint8_t databuffer[1023];
40+
__attribute__((__aligned__(4))) uint8_t databuffer[1023]; //__attribute__((__section__(".bss_hram0")))
41+
/*SAMD21 datasheet p804: Bits 31:0 – ADDR[31:0]: Data Pointer Address Value
42+
These bits define the data pointer address as an absolute word address in RAM.The two least significant bits must
43+
be zero to ensure the start address is 32-bit aligned.*/
4144

4245
uint32_t iso_pcksize;
4346
uint8_t iso_pckcode;
10 KB
Binary file not shown.

USBIso_Core_v1/USBIso_Core_v1/Arduino_template_v1/CDCIso.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ class CDCIso_ : public PluggableUSBModule {
4040

4141
uint8_t writebuffer[1023];
4242
uint8_t lenwritebuffer;
43-
uint8_t databuffer[1023];
43+
__attribute__((__aligned__(4))) uint8_t databuffer[1023]; //__attribute__((__section__(".bss_hram0")))
44+
/*SAMD21 datasheet p804: Bits 31:0 – ADDR[31:0]: Data Pointer Address Value
45+
These bits define the data pointer address as an absolute word address in RAM.The two least significant bits must
46+
be zero to ensure the start address is 32-bit aligned.*/
4447

4548
uint32_t iso_pcksize;
4649
uint8_t iso_pckcode;

0 commit comments

Comments
 (0)