Firmware Load from EEPROM ( 0xC2 boot)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
HiMa_3794786
Level 1
Level 1
10 sign-ins 5 sign-ins 5 replies posted

Hi,

I met a problem with devices of cy7c68013a and 24lc128.

I wrote a firmware and got two formats: .hex and .iic. After xxx.hex loaded into the RAM, the usb renumerated and worked well.  But when I loaded the xxx.iic into the eeprom, the usb can't renumerate.

I assure xxx.iic was loaded into eeprom and the format is right. The first byte is 0xC2.

I don't know whether the program in eeprom wasn't loaded into RAM or loaded but not renumerated.

Development environment

1) I am using a Cypress FX2LP DVK.

2) Firmware is being used after modifying AN 63787 - EZ - USB ® FX 2 L 1.

Confirmed

1) We probed the I2C line and confirmed that it was receiving the signal.

2) Using Vend_ax example (FX 2 LP DVK), read from EEPROM using vendor command and confirm that the first byte is 0 x C 2.

I attach a hex and an iic file here.

Regards,

thanks in advance

0 Likes
1 Solution

Hi Maeda-san,

We found that your program have an improper statement in the "Setup Data Available" interrupt.

Your code:

// Setup Data Available Interrupt Handler

void ISR_Sudav(void) interrupt 0

{

   GotSUD = TRUE;            // Set flag

   EZUSB_IRQ_CLEAR();

   USBIRQ = bmSUDAV;    // Clear SUDAV IRQ

  GotSUD = TRUE;            // Set flag

   EZUSB_IRQ_CLEAR();

   USBIRQ = bmSUDAV;    // Clear SUDAV IRQ

   GotSUD = TRUE;           // Set flag

   EZUSB_IRQ_CLEAR();

   USBIRQ = bmSUDAV;   // Clear SUDAV IRQ

}

Could you please modify your code as follows? Then, it works.

Modified code:

// Setup Data Available Interrupt Handler

void ISR_Sudav( void ) interrupt 0

{

   GotSUD = TRUE;         // Set flag

   EZUSB_IRQ_CLEAR( );

   USBIRQ = bmSUDAV; // Clear SUDAV IRQ

}

Best regards,

Hirotaka Takayama

View solution in original post

0 Likes
10 Replies
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Hi,

When programming HEX file to RAM, it will be executed Renumeration.

When Programming IIC file to EEPROM, Renumeration does not happen. You need to reset or disconnect/connect cable.

You can confirm these phenomenon using sample HEX and IIC file.

Best regards,

Hirotaka Takayama

0 Likes

Hi,

Thank you for your prompt response.

As described in the EZ-USB® Technical Reference Manual,

If, at power-on reset, the EZ-USB detects an EEPROM connected

to its I2C with the value 0xC2 at address zero, the

EZ-USB loads the EEPROM data into on-chip RAM. It also

sets the RENUM bit to ‘1’, causing device requests to be

handled by the firmware instead of the Default USB Device.

Do you have any other advice?

Best regards,

Hironori maeda

0 Likes

Hi Maeda-san,

Thank you for going through TRM deeply.

That is a point.

If Firmware is programmed to EEPROM, power-on reset does not happen. Then, FX2LP will NOT automatically start enumeration.

Best regards,

Hirotaka Takayama

0 Likes

Hello,

Thank you for your prompt response.

My way of asking was different.

I know that no power-on reset occurs when EEPROM is detected.

I will re-ask the question.

I wrote the firmware and got two formats: .hex and. Iic.

After xxx.hex loaded in RAM, usb was renamed and it worked.

However, when I load xxx.iic in eeprom and When the power is turned on again,

usb did not stand up.

Development environment

1) I am using a Cypress FX2LP DVK.

2) Firmware is being used after modifying AN 63787 - EZ - USB ® FX 2 L 1.

Verified

1) We investigated the I2C line and confirmed that we are receiving signals.

2) Use Vend_ax example (FX 2 LP DVK) to read from EEPROM using vendor command,

I confirmed that the first byte is 0 x C 2.

Best regards,

Hironori maeda

0 Likes

Hi Maeda-san,

Thank you for the clarification.

I understood your issue and we have not seen this issue before.

Can we get your Firmware source files?

If you are not able to post here, please send me directly via e-mail.

Best regards,

Hirotaka Takayama

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Takayama-san

Thank you for your reply.

I will transfer a set of project files.

The project file in the following folder has been refurbished.

\FX2LP Back To Back\Firmware\AutoMode\master

IDE-Version:

μVision V4.60.6.10

Tool Version Numbers:

Toolchain: PK51 Prof. Developers Kit Version: 9.51

Toolchain Path: C:\Keil\C51\BIN

C Compiler: C51.Exe V9.51

Assembler: A51.Exe V8.02b

Linker/Locator: BL51.Exe V6.22

Librarian: LIB51.Exe V4.29

Hex Converter: OH51.Exe V2.6

CPU DLL: S8051.DLL V3.85.0.0

Dialog DLL: DP51.DLL V2.62.0.1

Best regards,

Hironori Maeda

送信元: Hirotaka Takayama <community-manager@cypress.com>

宛先: Hironori Maeda <hmaeda@jeol.co.jp>,

日付: 2018/10/22 08:57

件名: Re: - Firmware Load from

EEPROM ( 0xC2 boot)

Hirotaka Takayama [

https://community.cypress.com/people/hrtk?et=watches.email.thread] replied

to the discussion

"Firmware Load from EEPROM ( 0xC2 boot)"

To view the discussion, visit:

https://community.cypress.com/message/176523?et=watches.email.thread#176523

0 Likes

Hi Maeda-san,

We found that your program have an improper statement in the "Setup Data Available" interrupt.

Your code:

// Setup Data Available Interrupt Handler

void ISR_Sudav(void) interrupt 0

{

   GotSUD = TRUE;            // Set flag

   EZUSB_IRQ_CLEAR();

   USBIRQ = bmSUDAV;    // Clear SUDAV IRQ

  GotSUD = TRUE;            // Set flag

   EZUSB_IRQ_CLEAR();

   USBIRQ = bmSUDAV;    // Clear SUDAV IRQ

   GotSUD = TRUE;           // Set flag

   EZUSB_IRQ_CLEAR();

   USBIRQ = bmSUDAV;   // Clear SUDAV IRQ

}

Could you please modify your code as follows? Then, it works.

Modified code:

// Setup Data Available Interrupt Handler

void ISR_Sudav( void ) interrupt 0

{

   GotSUD = TRUE;         // Set flag

   EZUSB_IRQ_CLEAR( );

   USBIRQ = bmSUDAV; // Clear SUDAV IRQ

}

Best regards,

Hirotaka Takayama

0 Likes

Hi Takayama-san,

Thank you for your reply.

It does not work even after code modification.

I wrote the firmware and got two formats: .hex and. Iic.

After xxx.hex loaded in RAM, usb was renamed and it worked.

However, when I load xxx.iic in eeprom and When the power is turned on again,

usb did not stand up.

When downloading from ROM, the following screen will always be output.

temp_181023.png

Do you have any advice?

Best regards,

Hironori Maeda

0 Likes

Hi Takayama-san,

I recognized the USB after recreating the project file.

Is it a malfunction caused by converting μVision V 2 to μVision V 4?

Thank you for what you have done.

Best regards,

Hironori Maeda

0 Likes

Hi Maeda-san,

I am happy to hear that.

Did you create your project on uVision 4 and your problem was resolved?

We will check whether the conversion has any problem.

FYI: If you converted the project from .uv2 format to .uvproj format, .uv2 project files can be compiled with uVision2/uVision4 whereas .uvproj project files CANNOT be compiled using uVision2 and only uVision4 or higher should be used.

Best regards,

Hirotaka Takayama

0 Likes