Pytrex wrote:
You've always had to erase the block and then rewrite the entire block, rather than just specific bytes.
Not only that, there are registers that need to be set to very specific states to be able to do that, and you definitely shouldn't write to the same block you're executing from .
You're reading the code correctly, it's exactly what it *appears* to be doing. I remember posting about that a while ago maybe ? never made progress; my guess was
- at some stage of the production process, the ROMs have some minimal bootloader code, likely running that alternate SID tree you found - as I mentioned the other day I've never found a way to trigger that tree, which is unfortunate because the 1A handler returns the some interesting info, including the LOADERxx and 705XYZ strings.
- they must have a RAM emulation (RAMER) mode going on, where some pages of the ROM are mapped in RAM. See the datasheet for how that works.
- in normal ops, as I recall the 705x doesn't hardfault if you try to write to ROM ? it just drops the data. If you wanted to determine whether or not you're running with RAMER, that would be one way of checking : try to write to ROM, if the value stayed, then it's actually mapped to RAM.
I looked more than once for any evidence entering / leaving RAMER , both in the Nissan kernels and the ROMs, and never found anything.
Note that the values it's writing / checking can be seen as 'Y' and 'N' , inside the FID struct : I can't help but make the connection between 'YES ' and 'NO' although what it refers to is unknown.
Code:
ROM:0000310C 35 58 36 31+struct_FID: .sdata "5X61BECCNA" ; FID
ROM:0000310C 42 45 43 43+ ; DATA XREF: ROM:off_118DA?o
ROM:0000310C 4E 41 00 00+ ; s***:off_11F28?o ...
ROM:0000310C 00 00 00 00+ .datab.b 7, 0 ; part no ?
ROM:0000310C 00 44 41 54+ .sdata "DATABASE" ; DATABASE_str
ROM:0000310C 41 42 41 53+ .data.b 0
ROM:0000310C 45 00 00 00+ .data.b 0 ; field_1C
ROM:0000310C 4E 00 53 48+ .data.b 0 ; field_1D
ROM:0000310C 37 30 35 35+ .data.b 'N ; YN
ROM:0000310C 31 33 4E 00+ .data.b 0 ; pad2
ROM:0000310C 0F FF FF FF+ .sdata "SH705513N" ; CPU
ROM:0000310C FF FF FF FF+ .data.b 0
ROM:0000310C FF FF FF FF+ .data.b h'F ; field_2A
ROM:0000310C FF FF FF 00+ .datab.b h'E, h'FF ; field_2B
ROM:0000310C 00 00 00 00+ .datab.b 9, 0 ; field_39