Getting back to ECU study, try to remove the hard wire 12v to flash.

This talks about BDM used on card Engine computer
Post Reply
usbbdm
Junior Member
Posts: 8962
Joined: Mon Jul 18, 2005 9:33 pm

Getting back to ECU study, try to remove the hard wire 12v to flash.

Post by usbbdm »

I have always wanted to remove the external 12V applied to the flash chip to be able to program the chip.
I have finally get my hand on one ECU411 again and I will see if it is possible to get 12V on the flash with the proper XML.
If I am able to make it I will post a video how this is done and where in the assembly code to look for.
Asylumwarp
Junior Member
Posts: 1
Joined: Sat Aug 22, 2020 8:00 pm

Re: Getting back to ECU study, try to remove the hard wire 12v to flash.

Post by Asylumwarp »

https://github.com/LegacyNsfw/PcmHacks/ ... d211bc4ebc#


///////////////////////////////////////////////////////////////////////////////
// Functions for erasing and writing flash
///////////////////////////////////////////////////////////////////////////////
#define SIM_BASE 0x00FFFA00
#define SIM_CSBARBT (*(unsigned short *)(SIM_BASE + 0x48)) // CSRBASEREG, boot chip select, chip select base addr boot ROM reg,
// must be updated to $0006 on each update of flash CE/WE states
#define SIM_CSORBT (*(unsigned short *)(SIM_BASE + 0x4a)) // CSROPREG, Chip select option boot ROM reg., $6820 for normal op
#define SIM_CSBAR0 (*(unsigned short *)(SIM_BASE + 0x4c)) // CSBASEREG, chip selects
#define SIM_CSOR0 (*(unsigned short *)(SIM_BASE + 0x4e)) // CSOPREG, *Chip select option reg., $1060 for normal op, $7060 for accessing flash chip
#define HARDWARE_IO (*(unsigned short *)(0xFFFFE2FA)) // Hardware I/O reg
#define FLASH_BASE (*(unsigned short *)(0x00000000))
#define FLASH_IDENTIFIER (*(uint32_t *)(0x00000000))
#define FLASH_MANUFACTURER (*(uint16_t *)(0x00000000))
#define FLASH_DEVICE (*(uint16_t *)(0x00000002))
#define SIGNATURE_COMMAND 0x9090
#define READ_ARRAY_COMMAND 0xFFFF
/*char volatile * const SIM_MCR = SIM_BASE + 0x00; // Module Control register
char volatile * const SIM_SYNCR = SIM_BASE + 0x04; // Clock synthesiser control register
char volatile * const SIM_RSR = SIM_BASE + 0x07; // Reset Status
char volatile * const SIM_SYPCR = SIM_BASE + 0x21; // System Protection
char volatile * const SIM_PICR = SIM_BASE + 0x22; // Periodic Timer
char volatile * const SIM_PITR = SIM_BASE + 0x24; //
char volatile * const SIM_SWSR = SIM_BASE + 0x27; //
char volatile * const SIM_CSPAR0 = SIM_BASE + 0x44; // chip sellect pin assignment
char volatile * const SIM_CSPAR1 = SIM_BASE + 0x46; //
char volatile * const SIM_CSBAR1 = SIM_BASE + 0x50;
char volatile * const SIM_CSOR1 = SIM_BASE + 0x52;
char volatile * const SIM_CSBAR2 = SIM_BASE + 0x54;
char volatile * const SIM_CSOR2 = SIM_BASE + 0x56;
char volatile * const SIM_CSBAR3 = SIM_BASE + 0x58;
char volatile * const SIM_CSOR3 = SIM_BASE + 0x5a;
char volatile * const SIM_CSBAR4 = SIM_BASE + 0x5c;
char volatile * const SIM_CSOR4 = SIM_BASE + 0x5e;
char volatile * const SIM_CSBAR5 = SIM_BASE + 0x60;
char volatile * const SIM_CSOR5 = SIM_BASE + 0x62;
char volatile * const SIM_CSBAR6 = SIM_BASE + 0x64;
char volatile * const SIM_CSOR6 = SIM_BASE + 0x66;*/

// Lock and unlock refers to the internal +12v supply to the flash chip, needed for erasing and writing.
void FlashLock();
void FlashUnlock();
// true to unlock, false to lock.
void FlashUnlock(bool unlock);

// Functions prefixed with Intel512 work with this chip ID
#define FLASH_ID_INTEL_512 0x00894471
#define FLASH_ID_INTEL_1024 0x0089889D
uint32_t Intel_GetFlashId();
uint8_t Intel_EraseBlock(uint32_t address);
uint8_t Intel_WriteToFlash(unsigned int payloadLengthInBytes, unsigned int startAddress, unsigned char *payloadBytes, int testWrite);
// Functions prefixed with Amd1024 work with this chip ID
#define FLASH_ID_AMD_1024 0x00012258
uint32_t Amd_GetFlashId();
uint8_t Amd_EraseBlock(uint32_t address);
uint8_t Amd_WriteToFlash(unsigned int payloadLengthInBytes, unsigned int startAddress, unsigned char *payloadBytes, int testWrite);

does this help?
usbbdm
Junior Member
Posts: 8962
Joined: Mon Jul 18, 2005 9:33 pm

Re: Getting back to ECU study, try to remove the hard wire 12v to flash.

Post by usbbdm »

I think I understand the code. The E411 is different and enable 12V is more complicated than above code.
I would stick now with a pull up to 12V method since we are using BDM method (the case is opened anyway) and adding a pull up resistor is doable.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests