File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ struct sketch_header_v1 {
3636#define SKETCH_FLAG_LINKED 0x02
3737#define SKETCH_FLAG_IMMEDIATE 0x04
3838
39+ #define SKETCH_RAM_BUFFER_LEN 131072
40+
3941#define TARGET_HAS_USB_CDC \
4042 DT_NODE_HAS_PROP(DT_PATH(zephyr_user), cdc_acm) && \
4143 (CONFIG_USB_DEVICE_STACK || CONFIG_USB_DEVICE_STACK_NEXT)
@@ -165,12 +167,12 @@ static int loader(const struct shell *sh) {
165167 uint8_t * ram_firmware = NULL ;
166168 uint32_t * ram_start = (uint32_t * )0x20000000 ;
167169 if (!sketch_valid ) {
168- ram_firmware = (uint8_t * )malloc (64 * 1024 );
170+ ram_firmware = (uint8_t * )malloc (SKETCH_RAM_BUFFER_LEN );
169171 if (!ram_firmware ) {
170172 printk ("Failed to allocate RAM for firmware\n" );
171173 return - ENOMEM ;
172174 }
173- memset (ram_firmware , 0 , 64 * 1024 );
175+ memset (ram_firmware , 0 , SKETCH_RAM_BUFFER_LEN );
174176 * ram_start = (uint32_t )& ram_firmware [0 ];
175177 }
176178 if (gpio_pin_get_dt (& spec ) == 0 ) {
You can’t perform that action at this time.
0 commit comments