mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
Enable TLS and 256/64 mode
This commit is contained in:
1 parent
4b3884a49d
commit
93bcde0176
4 files changed
+8
-15
No files matched your search
@@ -23,7 +23,7 @@ firmware.bin: firmware.elf
|
|||||||
$(PREFIX)-objcopy -O binary $< $@
|
$(PREFIX)-objcopy -O binary $< $@
|
||||||
$(PREFIX)-size --format=berkeley $<
|
$(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 $@
|
$(PREFIX)-gcc $(SOURCES) $(CFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
flash: firmware.bin
|
flash: firmware.bin
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ int main(void) {
|
|||||||
const char *sizes[] = {"128/192", "96/224", "64/256", "32/288"};
|
const char *sizes[] = {"128/192", "96/224", "64/256", "32/288"};
|
||||||
uint32_t mode = (FLASH->OBR >> 8) & 3U;
|
uint32_t mode = (FLASH->OBR >> 8) & 3U;
|
||||||
MG_INFO(("RAM/FLASH configuration: %s", sizes[mode]));
|
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
|
// Initialise Mongoose network stack
|
||||||
ethernet_init(); // Initialise ethernet pins
|
ethernet_init(); // Initialise ethernet pins
|
||||||
@@ -107,7 +107,7 @@ int main(void) {
|
|||||||
|
|
||||||
MG_INFO(("Initialising application..."));
|
MG_INFO(("Initialising application..."));
|
||||||
mg_http_listen(&mgr, "http://0.0.0.0:8000", fn, NULL);
|
mg_http_listen(&mgr, "http://0.0.0.0:8000", fn, NULL);
|
||||||
//web_init(&mgr);
|
web_init(&mgr);
|
||||||
|
|
||||||
MG_INFO(("Starting event loop"));
|
MG_INFO(("Starting event loop"));
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#define MG_ARCH MG_ARCH_NEWLIB
|
#define MG_ARCH MG_ARCH_NEWLIB
|
||||||
#define MG_OTA MG_OTA_FLASH
|
#define MG_OTA MG_OTA_FLASH
|
||||||
#define MG_DEVICE MG_DEVICE_CH32V307
|
#define MG_DEVICE MG_DEVICE_CH32V307
|
||||||
|
#define MG_TLS MG_TLS_BUILTIN
|
||||||
|
|
||||||
#define MG_ENABLE_TCPIP 1
|
#define MG_ENABLE_TCPIP 1
|
||||||
#define MG_ENABLE_CUSTOM_MILLIS 1
|
#define MG_ENABLE_CUSTOM_MILLIS 1
|
||||||
|
|||||||
+4
-12
@@ -1,21 +1,13 @@
|
|||||||
ENTRY( _start );
|
ENTRY( _start );
|
||||||
__stack_size = 2048;
|
__stack_size = 4096;
|
||||||
PROVIDE( _stack_size = __stack_size );
|
PROVIDE( _stack_size = __stack_size );
|
||||||
|
|
||||||
MEMORY {
|
MEMORY {
|
||||||
/* CH32V30x_D8C - CH32V307VC-CH32V307WC-CH32V307RC
|
/* Possible configurations: 192/128, 224/96, 256/64, 288/32 */
|
||||||
CH32V30x_D8 - CH32V303VC-CH32V303RC
|
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256k
|
||||||
FLASH + RAM supports the following configuration
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64k
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
.init : {
|
.init : {
|
||||||
_sinit = .;
|
_sinit = .;
|
||||||
|
|||||||
Reference in new issue
Block a user