File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ typedef struct _gz_stream_t {
42
42
uint8_t dict [DICT_SIZE ];
43
43
} gz_stream_t ;
44
44
45
- static gz_stream_t gz_stream ;
45
+ static gz_stream_t gz_stream SECTION_NOZERO_BSS ;
46
46
47
47
static int gz_stream_read_src (TINF_DATA * tinf ) {
48
48
UINT n ;
Original file line number Diff line number Diff line change @@ -754,7 +754,7 @@ typedef struct _dfu_state_t {
754
754
uint8_t buf [DFU_XFER_SIZE ] __attribute__((aligned (4 )));
755
755
} dfu_state_t ;
756
756
757
- static dfu_state_t dfu_state ;
757
+ static dfu_state_t dfu_state SECTION_NOZERO_BSS ;
758
758
759
759
static void dfu_init (void ) {
760
760
dfu_state .status = DFU_STATUS_IDLE ;
@@ -1070,7 +1070,7 @@ static const USBD_ClassTypeDef pyb_usbdd_class = {
1070
1070
pyb_usbdd_GetDeviceQualifierDescriptor ,
1071
1071
};
1072
1072
1073
- static pyb_usbdd_obj_t pyb_usbdd ;
1073
+ static pyb_usbdd_obj_t pyb_usbdd SECTION_NOZERO_BSS ;
1074
1074
1075
1075
static int pyb_usbdd_detect_port (void ) {
1076
1076
#if MBOOT_USB_AUTODETECT_PORT
@@ -1096,6 +1096,7 @@ static int pyb_usbdd_detect_port(void) {
1096
1096
1097
1097
static void pyb_usbdd_init (pyb_usbdd_obj_t * self , int phy_id ) {
1098
1098
self -> started = false;
1099
+ self -> tx_pending = false;
1099
1100
USBD_HandleTypeDef * usbd = & self -> hUSBDDevice ;
1100
1101
usbd -> id = phy_id ;
1101
1102
usbd -> dev_state = USBD_STATE_DEFAULT ;
Original file line number Diff line number Diff line change 27
27
#include <stdint.h>
28
28
#include <stddef.h>
29
29
30
+ // Use this to tag global static data in RAM that doesn't need to be zeroed on startup
31
+ #define SECTION_NOZERO_BSS __attribute__((section(".nozero_bss")))
32
+
30
33
#define ELEM_DATA_START (&_estack)
31
34
#define ELEM_DATA_MAX (ELEM_DATA_START + 1024)
32
35
Original file line number Diff line number Diff line change @@ -53,18 +53,25 @@ SECTIONS
53
53
_edata = .;
54
54
} >RAM AT> FLASH_BL
55
55
56
- /* Uninitialized data section */
56
+ /* Zeroed-out data section */
57
57
.bss :
58
58
{
59
59
. = ALIGN (4);
60
60
_sbss = .;
61
61
*(.bss*)
62
62
*(COMMON)
63
-
64
63
. = ALIGN (4);
65
64
_ebss = .;
66
65
} >RAM
67
66
67
+ /* Uninitialized data section */
68
+ .nozero_bss (NOLOAD) :
69
+ {
70
+ . = ALIGN (4);
71
+ *(.nozero_bss*)
72
+ . = ALIGN (4);
73
+ } >RAM
74
+
68
75
/* this just checks there is enough RAM for the stack */
69
76
.stack :
70
77
{
You can’t perform that action at this time.
0 commit comments