Forum Discussion

aiedb's avatar
aiedb
Icon for Occasional Contributor rankOccasional Contributor
9 days ago

writing a word to cfm1 using on chip flash ip on max10

hii i have the neek board development kit ,  and i am writing my own logic to perform a writing of an image to cfm1 flash sector for remote update 

 

i am transferring the image through uart from rpd file just like in nios rsu example lab .

i configured the on chip flash ip in this parameters 

data interface :parallel

read burst mode :incrementing

read burst count:8

configuration mode :dual compressed images

i set the burstcount to 1 

I managed to erase the CFM1 sector, and I read the status register to confirm that the erase of sectors 3 and 4 was successful. Sector 3 + 4 corresponds to CFM1.

Before performing the write operation, I verify that the on-chip flash is in the idle state by reading the CSR status register.

I place the word on the data_writedata signal of the Avalon bus with the correct address, assert the data_write signal, and then wait until waitrequest goes low before proceeding to the next word. I confirm that the write was successful by reading the ‘write successful’ bit in the CSR status register.

but sometimes in the middle of the file transfer ,  i get a write failure and i am not sure why , my clock on board is 50 mhz and i am using pll to generate  75mhz.

so i i am feeding the 75mhz clock to the  on chip flash ip and my own writing fsm logic  

Using SignalTap, I can see that the word before the one where the write failed was written successfully. 

I send each word over the UART interface with a delay of 2.5 ms, which I believe is sufficient for the write to complete. I also check the waitrequest signal before proceeding to the next word and verify that the on-chip flash is in the idle state.”

I would be thankful to know why I am getting a write failure and what I should check to resolve this issue?

thanks 

11 Replies

  • JohnT_Altera's avatar
    JohnT_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi,

     

    May I know what is the data length that you are using during write? Do you have issue in writing 32bit of data every time? Or it is happening during burst write?

     

    Can you share the SignalTap or design to further understand your issue?

    • aiedb's avatar
      aiedb
      Icon for Occasional Contributor rankOccasional Contributor

      hii yes 

      i write a 32 bit of data on avmm_data_writedata on the avalon bus , and i set the burstcount to 1

      i hold the avmm_write<='1'  as long as waitrequest=1 , and when i receive waitrequest=0 i disable the  avmm_write , update the next address and move to the next data to write 

      As noted earlier, write operations generally succeed when I verify the success flags in the CSR status register. However, I occasionally encounter a write failure when writing a 32-bit word, even though previous writes completed successfully.

      • JohnT_Altera's avatar
        JohnT_Altera
        Icon for Regular Contributor rankRegular Contributor

        Hi,

         

        May I know how frequent are you facing the write failure? May I know if your design has any timing issue?

  • FvM's avatar
    FvM
    Icon for Super Contributor rankSuper Contributor

    Hi,

    I implemented remote update in several MAX10 designs and didn't yet notice write completion taking longer than 1 ms. I see typical write duration of 40 to 100 us, but didn't try to capture maximum. We have a command response timeout of 1 ms, exceeding this interval would raise an error.

    Presuming MAX10 is healthy and receives correct supply voltage, I suspect there's something in your code causing the issues. In any case I'd use waitrequest to time write continuation instead of using fixed delay.

    Regards Frank

    • aiedb's avatar
      aiedb
      Icon for Occasional Contributor rankOccasional Contributor

      hii thanks thats what i am doing , holding the write untel waitreguest goes low 

      • JohnT_Altera's avatar
        JohnT_Altera
        Icon for Regular Contributor rankRegular Contributor

        Hi,

         

        Please try to clean up the timing and also avoid using fixed delay to see if it resolved your issue.

  • FvM's avatar
    FvM
    Icon for Super Contributor rankSuper Contributor

    That's of course correct according to AVMM spec, also address and data must be hold during waitrequest. 

    • aiedb's avatar
      aiedb
      Icon for Occasional Contributor rankOccasional Contributor

      hii i am working on it thanks:)