cancel
Showing results for 
Search instead for 
Did you mean: 

STUSB4500 NVM Customer Sector0-4 Write

luisfynn1
Associate II

Hello, this is Lewis

I have a question about "STUSB4500 NVM Customer Sector0-4 Write".
I would like to know the message below from the technical note "STUSB4500 NVM Register Description and General Access".(attach file)

"Load NVM data sector 0 (8 bytes) from start address 0x53
o I2C write: dev_addr = 0x28, reg_addr = 0x96, data = Data_C0, Data_C1, Data_C2, Data_C3, Data_C4, Data_C5, Data_C6, Data_C7"

I understood the above as follows.
-------------------------------------------------- ----------------
uint8_t buffer[8];
1. I2C_Read(0x28, 0x53, buffer, 8);
2. I2C_Write(0x28, 0x96, buffer, 8);
-------------------------------------------------- ----------------
Am I understanding this correctly???

 

but
1. https://github.com/usb-c/STUSB4500/blob/master/NVM_Flasher/Src/NVM/USBPD_CUST_NVM_API.c#L78
2.https://github.com/jefflongo/stusb4500/blob/master/src/stusb4500_nvm.c

If you go to many other sites,

//Write the 64-bit data to be written in the sector
if ( I2C_Write_USB_PD(Port,RW_BUFFER,SectorData,8) != HAL_OK )return -1;

Buffer[0]=FTP_CUST_PWR | FTP_CUST_RST_N; /*Set PWR and RST_N bits*/
if ( I2C_Write_USB_PD(Port,FTP_CTRL_0,Buffer,1) != HAL_OK )return -1;

It is like this.

I want to know the exact code.

 

right?? 

 

but 

 

0 REPLIES 0