diff --git a/examples/wch/ch32v307-make-baremetal-builtin/Makefile b/examples/wch/ch32v307-make-baremetal-builtin/Makefile index 347ac3a9..08258de7 100644 --- a/examples/wch/ch32v307-make-baremetal-builtin/Makefile +++ b/examples/wch/ch32v307-make-baremetal-builtin/Makefile @@ -23,7 +23,7 @@ firmware.bin: firmware.elf $(PREFIX)-objcopy -O binary $< $@ $(PREFIX)-size --format=berkeley $< -firmware.elf: $(SOURCES) link.ld hal.h mongoose_custom.h Makefile +firmware.elf: $(SOURCES) hal.h mongoose_custom.h Makefile $(PREFIX)-gcc $(SOURCES) $(CFLAGS) $(LDFLAGS) -o $@ flash: firmware.bin diff --git a/examples/wch/ch32v307-make-baremetal-builtin/main.c b/examples/wch/ch32v307-make-baremetal-builtin/main.c index efe6d6d6..a2484065 100644 --- a/examples/wch/ch32v307-make-baremetal-builtin/main.c +++ b/examples/wch/ch32v307-make-baremetal-builtin/main.c @@ -85,7 +85,7 @@ int main(void) { const char *sizes[] = {"128/192", "96/224", "64/256", "32/288"}; uint32_t mode = (FLASH->OBR >> 8) & 3U; MG_INFO(("RAM/FLASH configuration: %s", sizes[mode])); - // if (mode != 3) set_ram_size(3), mg_device_reset(); + if (mode != 2) set_ram_size(2); // Initialise Mongoose network stack ethernet_init(); // Initialise ethernet pins @@ -107,7 +107,7 @@ int main(void) { MG_INFO(("Initialising application...")); mg_http_listen(&mgr, "http://0.0.0.0:8000", fn, NULL); - //web_init(&mgr); + web_init(&mgr); MG_INFO(("Starting event loop")); for (;;) { diff --git a/examples/wch/ch32v307-make-baremetal-builtin/mongoose_custom.h b/examples/wch/ch32v307-make-baremetal-builtin/mongoose_custom.h index 621d7211..4a78276d 100644 --- a/examples/wch/ch32v307-make-baremetal-builtin/mongoose_custom.h +++ b/examples/wch/ch32v307-make-baremetal-builtin/mongoose_custom.h @@ -4,6 +4,7 @@ #define MG_ARCH MG_ARCH_NEWLIB #define MG_OTA MG_OTA_FLASH #define MG_DEVICE MG_DEVICE_CH32V307 +#define MG_TLS MG_TLS_BUILTIN #define MG_ENABLE_TCPIP 1 #define MG_ENABLE_CUSTOM_MILLIS 1 diff --git a/examples/wch/ch32v307-make-baremetal-builtin/vendor/link.ld b/examples/wch/ch32v307-make-baremetal-builtin/vendor/link.ld index 487a681b..929642ea 100644 --- a/examples/wch/ch32v307-make-baremetal-builtin/vendor/link.ld +++ b/examples/wch/ch32v307-make-baremetal-builtin/vendor/link.ld @@ -1,21 +1,13 @@ ENTRY( _start ); -__stack_size = 2048; +__stack_size = 4096; PROVIDE( _stack_size = __stack_size ); MEMORY { -/* CH32V30x_D8C - CH32V307VC-CH32V307WC-CH32V307RC - CH32V30x_D8 - CH32V303VC-CH32V303RC - FLASH + RAM supports the following configuration - FLASH-192K + RAM-128K - FLASH-224K + RAM-96K - FLASH-256K + RAM-64K - FLASH-288K + RAM-32K -*/ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 288K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K + /* Possible configurations: 192/128, 224/96, 256/64, 288/32 */ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256k + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64k } - SECTIONS { .init : { _sinit = .;