[Ovmsdev] OVMS Poller module/singleton

Michael Balzer dexter at expeedo.de
Sun Jan 26 23:40:30 HKT 2025


Simon,

as you can see yourself, this looks like your `BMSSetupPolling()` tries 
to access some uninitialized vector.

Maybe `ConfigChanged(NULL);` should be done after what follows ``// Init 
polling:``?

Regards,
Michael


Am 26.01.25 um 16:25 schrieb Simon Ehlen via OvmsDev:
> Hi Michael,
>
> please find attached the corresponding backtrace.
> However, I don't think it has anything to do with the code.
> Because on the one hand I only changed the timing for the mcp2515 and 
> on the other hand the firmware in the other ota partition crashes with 
> the same error now.
> The firmware in the other ota partition has been running for several 
> days without a single crash, so that makes no sense to me. Unless it's 
> a general problem with the flash.
>
> Cheers,
> Simon
>
> Am 26.01.2025 um 16:16 schrieb Michael Balzer via OvmsDev:
>> Simon,
>>
>> you need to decode the backtrace yourself, as you have local code 
>> additions we do not have. Use the a2l script (in support).
>>
>> Regards,
>> Michael
>>
>>
>> Am 26.01.25 um 14:52 schrieb Simon Ehlen via OvmsDev:
>>> Hi,
>>> it is of course possible that it is due to something else. But that 
>>> was the only code change I flashed.
>>> According to the log, it dies at this point:
>>>
>>> I (2369) v-ffe: Ford Focus Electric vehicle module
>>> I (2369) cellular-modem-auto: Power Cycle 2000ms
>>> I (2379) mcp2515: can2: SetPowerMode on
>>> D (2439) mcp2515: can2: Set register (0x2b val 0x00->0x00)
>>> D (2449) mcp2515: can2:  - read register (0x2b : 0x00)
>>> D (2449) mcp2515: can2: Set register (0x60 val 0x00->0x64)
>>> D (2459) mcp2515: can2:  - read register (0x60 : 0x64)
>>> D (2459) mcp2515: can2: Set register (0x0c val 0x00->0x0c)
>>> D (2469) mcp2515: can2:  - read register (0x0c : 0x0c)
>>> D (2469) mcp2515: can2: Change op mode to 0x60
>>> D (2489) mcp2515: can2:  read CANSTAT register (0x0e : 0x60)
>>> E (2489) can: can2: intr=1 rxpkt=1 txpkt=0 errflags=0x23401c01 
>>> rxerr=0 txerr=0 rxinval=0 rxovr=0 txovr=0 txdelay=0 txfail=0 
>>> wdgreset=0 errreset=0
>>> Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception 
>>> was unhandled.
>>> Core 1 register dump:
>>> PC      : 0x4008a830  PS      : 0x00060a30  A0      : 0x801aaa31 
>>> A1      : 0x3ffc4ab0
>>> A2      : 0x00120000  A3      : 0x3ffc4af0  A4      : 0x00000024 
>>> A5      : 0x00120000
>>> A6      : 0x000007e4  A7      : 0x000007ec  A8      : 0x00000000 
>>> A9      : 0x3ffc4a80
>>> A10     : 0x00000000  A11     : 0x40084a7c  A12     : 0x00000003 
>>> A13     : 0x00000008
>>> A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x00000010 
>>> EXCCAUSE: 0x0000001d
>>> EXCVADDR: 0x00120000  LBEG    : 0x4008a82c  LEND    : 0x4008a848 
>>> LCOUNT  : 0x00000001
>>>
>>> ELF file SHA256: 5e6a07d4d02b1a79
>>>
>>> Backtrace: 0x4008a830:0x3ffc4ab0 0x401aaa2e:0x3ffc4ac0 
>>> 0x401aab8a:0x3ffc4ae0 0x401aada5:0x3ffc4b40 0x401ab1f7:0x3ffc4b90 
>>> 0x401ab22e:0x3ffc4c00 0x401a3c07:0x3ffc4c20 0x401a453a:0x3ffc4c50 
>>> 0x401a4618:0x3ffc4ca0 0x4011a697:0x3ffc4d20 0x4011a256:0x3ffc4d90 
>>> 0x40119382:0x3ffc4dd0 0x4011979d:0x3ffc4e00 0x40119b8c:0x3ffc4e60 
>>> 0x40119c11:0x3ffc4ea0
>>>
>>> It then boots to a command prompt
>>> E (1378) housekeeping: Auto init inhibited: too many early crashes (5)
>>>
>>> Does that tell you anything?
>>>
>>> Cheers,
>>> Simon
>>>
>>>
>>> Am 26.01.2025 um 14:05 schrieb Michael Balzer via OvmsDev:
>>>> Simon,
>>>>
>>>> you need to connect via USB to set the boot partition if you cannot 
>>>> access the module.
>>>>
>>>> But… there is no way a wrong MCP2515 timing could cause this. I'd 
>>>> look for other potential causes.
>>>>
>>>> Regards,
>>>> Michael
>>>>
>>>>
>>>> Am 26.01.25 um 13:58 schrieb Simon Ehlen via OvmsDev:
>>>>> Hi Michael,
>>>>>
>>>>> I tried your first suggestion, but after this change the OVMS no 
>>>>> longer boots at all.
>>>>>
>>>>> cnf1=0xc3; cnf2=0xaa; cnf3=0x85;
>>>>>
>>>>> What is the easiest way to select the firmware on the second 
>>>>> partition? Is there a way via the SD card or do I have to connect 
>>>>> the OVMS with USB?
>>>>>
>>>>> Cheers,
>>>>> Simon
>>>>>
>>>>> Am 26.01.2025 um 12:51 schrieb Michael Balzer via OvmsDev:
>>>>>> Simon,
>>>>>>
>>>>>> Am 25.01.25 um 21:00 schrieb Simon Ehlen via OvmsDev:
>>>>>>> Are adjustments/improvements also necessary at 125KBPS for CAN2/3?
>>>>>>
>>>>>> I've had a look at SAE J2284-1 for the 125 kbit timing, and it 
>>>>>> seems for this speed, the esp-idf, the mcp_can lib and our 
>>>>>> current driver are outside the spec.
>>>>>>
>>>>>> SAE recommends a sync jump width of 3 for low (nq=8) and 4 for 
>>>>>> higher resolutions, and single sampling at 62.5% (range 58.3…69.2%).
>>>>>>
>>>>>> The esp-idf driver would use a SJW of 3 (would better be 4 as 
>>>>>> nq=20) and single sampling at 80% (very late). The Arduino lib 
>>>>>> uses SJW=2 (too low) and triple sampling at 75% (late).
>>>>>>
>>>>>> Our current driver uses a SJW of 1 (much too low) and triple 
>>>>>> sampling at 56.25% (too early):
>>>>>>     case CAN_SPEED_125KBPS:
>>>>>>       cnf1=0x03; cnf2=0xf0; cnf3=0x86;
>>>>>>       // BRP=3, PRSEG=1, PS1=7, PS2=7, SJW=1, BTLMODE=1, SAM=1, 
>>>>>> SOF=1, WAKFIL=0 → Sample 3x at 9/16 = 56,25%
>>>>>>
>>>>>> (Note: the current comment in the source is incorrect, the tq 
>>>>>> values need each to be read as +1)
>>>>>>
>>>>>> Possible SAE solutions for the MCP2515:
>>>>>>
>>>>>> a)
>>>>>>     case CAN_SPEED_125KBPS:
>>>>>>       // SAE J2284-1:
>>>>>>       // BRP=3, PRSEG=3, PS1=6, PS2=6, SJW=4, BTLMODE=1, SAM=0, 
>>>>>> SOF=1, WAKFIL=0 → Sample point at 10/16 = 62.5%
>>>>>>       cnf1=0xc3; cnf2=0xaa; cnf3=0x85;
>>>>>> b)
>>>>>>     case CAN_SPEED_125KBPS:
>>>>>>       // SAE J2284-1:
>>>>>>       // BRP=3, PRSEG=3, PS1=7, PS2=5, SJW=4, BTLMODE=1, SAM=0, 
>>>>>> SOF=1, WAKFIL=0 → Sample point at 11/16 = 68.8%
>>>>>>       cnf1=0xc3; cnf2=0xb2; cnf3=0x84;
>>>>>>
>>>>>> Please try.
>>>>>>
>>>>>> Btw, if anyone would like to experiment: the Microchip timing 
>>>>>> calculator needs to be set to 16 MHz (that's our MCP2515 clock), 
>>>>>> and you need to add 0x80 to the cnf3 byte generated (that's the 
>>>>>> SOF flag, cannot be set in the UI).
>>>>>>
>>>>>> Regards,
>>>>>> Michael
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> OvmsDev mailing list
>>>>>> OvmsDev at lists.openvehicles.com
>>>>>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>>>>>
>>>>> _______________________________________________
>>>>> OvmsDev mailing list
>>>>> OvmsDev at lists.openvehicles.com
>>>>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>>>>
>>>>
>>>> _______________________________________________
>>>> OvmsDev mailing list
>>>> OvmsDev at lists.openvehicles.com
>>>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>>>
>>> _______________________________________________
>>> OvmsDev mailing list
>>> OvmsDev at lists.openvehicles.com
>>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>>
>>
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.openvehicles.com
>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Am Rahmen 5 * D-58313 Herdecke
Fon 02330 9104094 * Handy 0176 20698926

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20250126/93540d1d/attachment.sig>


More information about the OvmsDev mailing list