<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div>I’ve received a bug report that the Tesla Roadster vehicle module is crashing when the digital speedo option is used (with latest 3.2.008 firmware):<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/324" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">#324 </span>Tesla Roadster digital speedo crashing on latest firmware</a></blockquote><div class=""><br class=""></div><div class="">Backtrace is:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 14px;" class="">0x4008b72f is in invoke_abort (esp-idf/components/esp32/panic.c:156).<br class="">0x4008b9c9 is in abort (esp-idf/components/esp32/panic.c:171).<br class="">0x40097765 is in xTimerCreate (esp-idf/components/freertos/timers.c:385).<br class="">0x4018ccaa is in OvmsVehicleTeslaRoadster::IncomingFrameCan1(CAN_frame_t*) (components/vehicle_teslaroadster/src/vehicle_teslaroadster.cpp:375).<br class="">0x4015ba95 is in OvmsVehicle::RxTask() (components/vehicle/vehicle.cpp:1138).<br class="">0x4027fee2 is in OvmsVehicleRxTask(void*) (components/vehicle/vehicle.cpp:940).</span></font></div></blockquote><div class=""><br class=""></div><div class="">and the abort is called by an assert:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 14px;" class="">configASSERT( ( xTimerPeriodInTicks > 0 ) );</span></font></div></blockquote><div class=""><br class=""></div><div class="">In our default sdkconfig configurations, we have:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 14px;" class="">CONFIG_FREERTOS_HZ=100</span></font></div></blockquote><div class=""><br class=""></div><div class="">so I think that means there are 0.1 ticks per millisecond, and setting any timer <10ms will trigger the assertion crash. I have no idea why it wasn’t a problem when this was written (a few years ago), but the crash is definitely caused by this. Maybe at some time ago we disabled abort on assertions?</div><div class=""><br class=""></div><div class="">Anyway, reviewing the code there are a few places we use xTimerCreate and this can happen. Most are hard-coded times greater than 10ms. The remaining ones are:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">ovms_events.cpp in the SignalRaise function</li><li class="">vehicle_teslaroadster.cpp in two places</li></ul></div><div class=""><br class=""></div><div class="">I changed both of these to avoid the issue (enforce ticks to be >= 1).</div><div class=""><br class=""></div><div class="">Just beware that we can’t have timers less than 10ms with our current configuration.</div><div class=""><br class=""></div><div class="">Regards, Mark.</div><div class=""><br class=""></div></body></html>