How to download PBL from Convers+

IPC - Instrument cluster panels (like Convers+)
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

How to download PBL from Convers+

Post by Go4IT »

Lately i needed to gather the primary bootloader (PBL) from an Convers+. This is no part of any downloadable firmware, it is programmed in factory and (think) never been updated or changed. But to get behind some "secrects" of the firmware it's needed.
I managed to download it via JTAG using my Segger J-Link interface. You can do it with "J-Link Commander" like this (i put a comment after each command, which you don't enter of course, just to make clear what it does):

Code: Select all

connect // then choose MAC7116 as device, auto IR-Len detection, 1000 khz JTAG-clock

halt // stop CPU

be // set to Big Endian mode (IMPORTANT!)

save c:\temp\pbl.bin 0, 5000 // load memory location 0x0000 0000 - 0x0000 4FFF and store it into a binary file at c:\temp
So simple, eh? ;-)
You could also use "J-Link Flash" or "J-Link Memory" tool for this task.

Hope this help somebody, sometime...
paxtonix
Active member
Posts: 99
Joined: 16 Oct 2019, 14:25

Re: How to download PBL from Convers+

Post by paxtonix »

Im waiting for my Jtag as well- then the magic will start :D
Tourist
DGAlexandru
Pro
Posts: 364
Joined: 04 Aug 2019, 22:47

Re: How to download PBL from Convers+

Post by DGAlexandru »

I think JTAG-ing this devices it's too much for some users... either because they are not interested in doing it or because connecting something wrong might lead to a dead chip (MAC7116).

Did you tried to disassemble the BootLoader that is sent over CAN?
It is loaded in RAM then I think the PC_Register is set to one of its functions, without rebooting the CPU.
Having a pseudo-code for it will allow us to understand easier the main functions of MAC7116, like EEPROM, Internal Flash and External Flash access and also CAN communication, without any other functions interference. Also we could find the CAN message it needs in order to be able to also access Internal Flash address range 0x0000 0000 - 0x0000 4FFF.

I'm still struggling to find the initialization values for the CPU in JTAG-mode in order to access also External Flash. Segger J-Link software doesn't have defined this type of External Flash, but it has similar ones and you can also define one yourself, which I did, but I can't access all the banks and even like this the dump has mixed bytes from different banks. :evil:
tomy75
Active member
Posts: 112
Joined: 13 Jun 2019, 21:57

Re: How to download PBL from Convers+

Post by tomy75 »

Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: How to download PBL from Convers+

Post by Go4IT »

@DGAlexandru, the one downloaded for update, the SBL - Secondary Bootloader is something completely different than the PBL. It is just a software which takes control over the system instead of the firmware. It would be also interesting to know how it works, but i will start a different thread for discussing this topic ;)
Maybe, someday we are able to build own software instead of SBL to do "funny" things.

What's so important of the PBL is that it contains library functions used by the firmware and vice versa.
Also, like the SBL it is relatively small (compared to the huge firmware of the Convers+ system, which also contains an RTOS) and so a chance to fully understand what it does.
paxtonix
Active member
Posts: 99
Joined: 16 Oct 2019, 14:25

Re: How to download PBL from Convers+

Post by paxtonix »

Go4IT wrote: 30 Dec 2019, 12:34 Maybe, someday we are able to build own software instead of SBL to do "funny" things.
I like your approach.
Tourist
User avatar
Stevebe
Pro
Posts: 258
Joined: 08 Feb 2019, 12:28

Re: How to download PBL from Convers+

Post by Stevebe »

Go4IT wrote: 30 Dec 2019, 11:28
connect // then choose MAC7116 as device, auto IR-Len detection, 1000 khz JTAG-clock

halt // stop CPU

be // set to Big Endian mode (IMPORTANT!)

save c:\temp\pbl.bin 0, 5000 // load memory location 0x0000 0000 - 0x0000 4FFF and store it into a binary file at c:\temp
[/code]
So simple, eh? ;-)
You could also use "J-Link Flash" or "J-Link Memory" tool for this task.

Hope this help somebody, sometime...
Are you setting moda and mod b is it mod b hi
Have you got a flash project file or is only in commander.
Digimod
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: How to download PBL from Convers+

Post by Go4IT »

mod a or mod b ? No clue what that is.
I just use "be" command to get Big Endian byteorientation.
And yes, i've done it all in J-Link Commander and there it's no so easy having a setup file. Think it can be done with a JLinkScript file, but didn't do this right now...
User avatar
Stevebe
Pro
Posts: 258
Joined: 08 Feb 2019, 12:28

Re: How to download PBL from Convers+

Post by Stevebe »

Go4IT wrote: 31 Dec 2019, 15:25 mod a or mod b ? No clue what that is.
Processor MODE pin 70 and 71
3991BE98-38A1-4C7C-9BB0-64358A784D40.jpeg
You do not have the required permissions to view the files attached to this post.
Digimod
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: How to download PBL from Convers+

Post by Go4IT »

Ah, now i know what you mean :-) I already measured those pins out a while ago and therefore know that it is "Normal Single Chip Mode": viewtopic.php?f=25&t=30#p188
Post Reply