bpmct
03/15/2023, 1:21 AMsh
[jaguar] INFO: running Jaguar device 'wiro' (id: '402d9458-9cf0-42c7-9cee-09714a97d6bf') on 'http://192.168.86.200:9000'
[jaguar] INFO: program 7e4b355c-9066-ca1b-a357-14f20db16477 started
Hello test!
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40386f10
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x48
load:0x403ce000,len:0x64c
load:0x403d0000,len:0x2318
entry 0x403ce000
[toit] INFO: starting <v2.0.0-alpha.64>
[wifi] DEBUG: connecting
[wifi] DEBUG: connected
[wifi] INFO: network address dynamically assigned through dhcp {ip: 192.168.86.200}
[wifi] INFO: dns server address dynamically assigned through dhcp {ip: [192.168.86.1]}
[jaguar] INFO: running Jaguar device 'wiro' (id: '402d9458-9cf0-42c7-9cee-09714a97d6bf') on 'http://192.168.86.200:9000'
My code:
import uart
import gpio
import reader show BufferedReader
import writer show Writer
main:
print "Hello test!"
port := uart.Port
--rx=gpio.Pin 20
--tx=gpio.Pin 21
--baud_rate=9600
writer := Writer port
10.repeat:
print "Writing"
writer.write "Test \n\n\n"
sleep --ms=1000
bpmct
03/15/2023, 1:22 AMfloitsch
03/15/2023, 6:05 AMfloitsch
03/15/2023, 8:11 AMHello test!
Guru Meditation Error: Core 0 panic'ed (Memory protection fault).
memory type: IRAM0_SRAM
faulting address: 0x40380284
world: PMS_WORLD_0
operation type: WRITE
Core 0 register dump:
MEPC : 0x4200594c RA : 0x40382ac4 SP : 0x3fca5e80 GP : 0x3fc94200
TP : 0x3fc8cc00 T0 : 0x4005890e T1 : 0x40391da6 T2 : 0x00009999
S0/FP : 0x3fcbb49c S1 : 0x3c1b2101 A0 : 0x3fcbb839 A1 : 0x3fcb4fe4
A2 : 0x3fca6da0 A3 : 0x3fc9c098 A4 : 0x3fca7b20 A5 : 0x00000035
A6 : 0x3fcb4fd8 A7 : 0x3fcbb6b5 S2 : 0x3fcb4fe0 S3 : 0x3fc9b000
S4 : 0x3fc96560 S5 : 0xfffe42a6 S6 : 0x00017dde S7 : 0x3fc96830
S8 : 0x3fca5f30 S9 : 0x00000004 S10 : 0x3c1b39fc S11 : 0x3c1b0000
T3 : 0x00000000 T4 : 0x3c1b7081 T5 : 0x00000580 T6 : 0x3bc3a72c
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x0000001a MTVAL : 0x00004942
MHARTID : 0x00000000
Stack memory:
3fca5e80: 0x3fcbab68 0x00000000 0x3fcba9a8 0x3c0f2e40 0x3fca0a38 0x3c1b2101 0x3fcbb49c 0x40382ac4
3fca5ea0: 0x3fcaa658 0x00000000 0x420058d0 0x4038e4e4 0x00000000 0x3c1b704d 0x3fcbb745 0x420e7b5e
3fca5ec0: 0x00000000 0x00000002 0x00000004 0x00000000 0x3fca08f0 0x3fca5f88 0x00000000 0x00000000
3fca5ee0: 0x00000000 0x00000000 0x00000000 0x3fca0a38 0x3fca0a20 0x00000000 0x00000000 0x3fca0958
3fca5f00: 0x3fca08f0 0x3fca5f88 0x3fcba9a8 0x4202ba16 0x00000000 0x00000000 0x00000000 0xffffffff
3fca5f20: 0x00000042 0x003f08eb 0x00000b40 0x420e858c 0x00000001 0x00000000 0x00000000 0x00000000
3fca5f40: 0x3fca5f88 0x00000001 0x3fc9dfe8 0x420e7c7e 0x3fca0a20 0xffffffff 0x3fc9dfe8 0x00000000
floitsch
03/15/2023, 8:19 AMmikkel.damsgaard
03/15/2023, 8:37 AMfloitsch
03/15/2023, 8:47 AMimport gpio
main:
pin := gpio.Pin 4
floitsch
03/15/2023, 8:47 AMGuru Meditation Error: Core 0 panic'ed (Memory protection fault).
memory type: IRAM0_SRAM
faulting address: 0x40380284
0x40380284: toit::GpioResourceGroup::isr_handler(void*) at ??:?
world: PMS_WORLD_0
operation type: WRITE
Stack dump detected
Core 0 register dump:
MEPC : 0x42005c6e RA : 0x40382d88 SP : 0x3fca5e80 GP : 0x3fc93e00
0x42005c6e: toit::primitive_init(toit::Process*, toit::Object**) at ./build/esp32c3/./src/resources/gpio_esp32.cc:230
0x40382d88: toit::Object::is_marked() at ./build/esp32c3/./src/objects.h:73
(inlined by) toit::Primitive::is_error(toit::Object*) at ./build/esp32c3/./src/primitive.h:1184
(inlined by) toit::Interpreter::run() at ./build/esp32c3/./src/interpreter_run.cc:1052
TP : 0x3fc8c8b8 T0 : 0x3c142db3 T1 : 0x40391884 T2 : 0x3c140ef5
0x40391884: _calloc_r at /home/flo/code/opentoit/third_party/esp-idf/components/newlib/heap.c:70
floitsch
03/15/2023, 10:17 AMIRAM_ATTR
on a variable. The C3 has a memory protection enabled that disallows writing into IRAM once the program has been loaded. It's a security feature.
However, by adding an IRAM_ATTR
to one of our global variables, we crashed the system when writing into that field.
Unfortunately this happened when setting up the GPIO pins.
The fix should be included in Toit v2.0.0-alpha.66mikkel.damsgaard
03/15/2023, 10:31 AMfloitsch
03/15/2023, 10:31 AMIRAM_ATTR
...bpmct
03/15/2023, 11:40 AMfloitsch
03/15/2023, 12:12 PMfloitsch
03/15/2023, 12:13 PMkasperl
03/15/2023, 2:26 PMbpmct
03/15/2023, 11:07 PMfloitsch
03/15/2023, 11:08 PMfloitsch
03/15/2023, 11:09 PMbpmct
03/15/2023, 11:13 PMfloitsch
03/15/2023, 11:15 PMfloitsch
03/15/2023, 11:15 PMfloitsch
03/15/2023, 11:16 PMfloitsch
03/15/2023, 11:16 PMbpmct
03/15/2023, 11:19 PMbpmct
03/15/2023, 11:20 PMbpmct
03/15/2023, 11:20 PMfloitsch
03/15/2023, 11:22 PMbpmct
03/15/2023, 11:23 PMfloitsch
03/15/2023, 11:24 PM