Procházet zdrojové kódy

Fix issue about illegal load of EXC_RETURN into PC on stm32 board (#98)

wenyongh před 6 roky
rodič
revize
9ed6d6af0a

+ 3 - 0
samples/gui/wasm-runtime-wgl/src/platform/zephyr/iwasm_main.c

@@ -69,6 +69,9 @@ static bool host_init()
 
 
 int host_send(void * ctx, const char *buf, int size)
 int host_send(void * ctx, const char *buf, int size)
 {
 {
+    if (!uart_dev)
+        return 0;
+
     for (int i = 0; i < size; i++)
     for (int i = 0; i < size; i++)
         uart_poll_out(uart_dev, buf[i]);
         uart_poll_out(uart_dev, buf[i]);
 
 

+ 2 - 0
samples/gui/wasm-runtime-wgl/zephyr-build/prj.conf

@@ -5,3 +5,5 @@ CONFIG_PRINTK=y
 CONFIG_LOG=y
 CONFIG_LOG=y
 #CONFIG_UART_2=y
 #CONFIG_UART_2=y
 CONFIG_UART_INTERRUPT_DRIVEN=y
 CONFIG_UART_INTERRUPT_DRIVEN=y
+CONFIG_STACK_SENTINEL=y
+CONFIG_MAIN_STACK_SIZE=2048

+ 4 - 1
samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c

@@ -55,7 +55,7 @@ static bool host_init()
     uart_dev = device_get_binding(HOST_DEVICE_COMM_UART_NAME);
     uart_dev = device_get_binding(HOST_DEVICE_COMM_UART_NAME);
     if (!uart_dev) {
     if (!uart_dev) {
         printf("UART: Device driver not found.\n");
         printf("UART: Device driver not found.\n");
-        return;
+        return false;
     }
     }
     uart_irq_rx_enable(uart_dev);
     uart_irq_rx_enable(uart_dev);
     uart_irq_callback_set(uart_dev, uart_irq_callback);
     uart_irq_callback_set(uart_dev, uart_irq_callback);
@@ -64,6 +64,9 @@ static bool host_init()
 
 
 int host_send(void * ctx, const char *buf, int size)
 int host_send(void * ctx, const char *buf, int size)
 {
 {
+    if (!uart_dev)
+        return 0;
+
     for (int i = 0; i < size; i++)
     for (int i = 0; i < size; i++)
         uart_poll_out(uart_dev, buf[i]);
         uart_poll_out(uart_dev, buf[i]);
 
 

+ 2 - 0
samples/littlevgl/vgl-wasm-runtime/zephyr-build/prj.conf

@@ -5,3 +5,5 @@ CONFIG_PRINTK=y
 CONFIG_LOG=y
 CONFIG_LOG=y
 #CONFIG_UART_2=y
 #CONFIG_UART_2=y
 CONFIG_UART_INTERRUPT_DRIVEN=y
 CONFIG_UART_INTERRUPT_DRIVEN=y
+CONFIG_STACK_SENTINEL=y
+CONFIG_MAIN_STACK_SIZE=2048