Accelerometer causes out of memory issue
-
Edit: i thought this happened after upgrading to RRF 3.4.5, please move to right forum.
When using an accelerometer, detected in the input shaping plugin, homing the machine causes it to reset.
Using this, which is correct for my setup i believe. removing this line from the config fixes the issue.
M955 P0 C"spi.cs3+spi.cs4" I10 ;Accelerometer
=== Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.4.5 (2022-11-30 19:36:12) running on Duet WiFi 1.02 or later + DueX5 Board ID: 08DGM-9T6BU-FG3SN-6J9FJ-3SN6L-9SWVG Used output buffers: 1 of 26 (12 max) === RTOS === Static ram: 23836 Dynamic ram: 85312 of which 0 recycled Never used RAM 76, free system stack 184 words Tasks: NETWORK(ready,10.8%,237) ACCEL(notifyWait,0.0%,348) HEAT(notifyWait,0.0%,333) Move(notifyWait,0.0%,363) DUEX(notifyWait,0.0%,24) MAIN(running,86.1%,444) IDLE(ready,3.1%,30), total 100.0% Owned mutexes: WiFi(NETWORK) === Platform === Last reset 00:00:24 ago, cause: software Last software reset at 2022-12-29 20:04, reason: OutOfMemory, GCodes spinning, available RAM 4, slot 0 Software reset code 0x41c3 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x20003e38 Task Move Freestk 324 ok Stack: 2001aa5c 0041009d 00000002 00410273 00000008 00000014 20004038 0042b43f 2001aa78 00425223 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6c000000 20003eec 2001d540 2000c9e4 20003f18 00000000 00016e35 00425659 3fb504f3 Error status: 0x00 Step timer max interval 0 MCU temperature: min 25.0, current 25.5, max 29.3 Supply voltage: min 24.1, current 24.2, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 99/3, heap memory allocated/used/recyclable 2048/46/0, gc cycles 0 Events: 0 queued, 0 completed Driver 0: standstill, SG min n/a Driver 1: standstill, SG min n/a Driver 2: standstill, SG min n/a Driver 3: standstill, SG min n/a Driver 4: standstill, SG min n/a Driver 5: standstill, SG min n/a Driver 6: standstill, SG min n/a Driver 7: standstill, SG min n/a Driver 8: standstill, SG min n/a Driver 9: standstill, SG min n/a Driver 10: Driver 11: Date/time: 2022-12-29 20:05:23 Cache data hit count 901695954 Slowest loop: 6.54ms; fastest: 0.19ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 10 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 0.7ms, write time 0.0ms, max retries 0 === Move === DMs created 83, segments created 0, maxWait 0ms, bed compensation in use: none, comp offset 0.000 === MainDDARing === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === AuxDDARing === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 Heater 1 is on, I-accum = 0.0 === GCodes === Segments left: 0 Movement lock held by null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is idle in state(s) 0 Autopause is idle in state(s) 0 Code queue is empty === DueX === Read count 1, 2.48 reads/min === Network === Slowest loop: 128.53ms; fastest: 0.00ms Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) HTTP sessions: 1 of 8 = WiFi = Network state is active WiFi module is connected to access point Failed messages: pending 0, notready 0, noresp 0 WiFi firmware version 1.27 WiFi MAC address 84:f3:eb:83:2b:76 WiFi Vcc 3.37, reset reason Power up WiFi flash size 4194304, free heap 24728 WiFi IP address 192.168.20.49 WiFi signal strength -52dBm, mode 802.11n, reconnections 0, sleep mode modem Clock register 00002002 Socket states: 0 0 0 0 0 0 0 0
-
Also, there's no issue collecting the accelerometer data with M956, it creates a CSV with data.
However this also happens in reverse. if i remove the accelerometer setup, home the machine then try to run M955 it will also crash with out of memory. so it's either connect the accelerometer or home the axis, can't have both. lol...
edit: i've disable the display and freed up more memory and it works, for now.
-
-
@mrwizzard thanks for your feedback. Unfortunately, there is only 128kb RAM on Duet 2 and this is easily used up. When a Duet 2 WiFi is booted with a minimal config.g file, there are 15840 bytes of Never Used RAM according to M122. This is easily used up by such things as creating tools, creating variables, creating heaters and fans, configuring a 12864 display and creating menu items, and many other things. The 12864 display in particular uses quite a lot of RAM.
I've been through the linker map to identify where we might save some RAM space several times already. I've just done that again and managed to increase the Never Used RAM on the same system to 16056 bytes. So 3.5beta2 may have a small amount of extra RAM available - if it doesn't get used by something else first.