5 Replies Latest reply on Jun 28, 2018 12:35 AM by ring

    Flash write API

    769482734_1650581

      Hi All:

          客户使用CY8C4146AZI-S433来开发一款BLDC电机的产品,需要对芯片的flash进行操作,关于Psoc4的flash的操作有几个问题需要请教一下:

          1:我发现CyFlash.c里面的函数uint32 CySysFlashWriteRow(uint32 rowNum, const uint8 rowData[])是一个先进性擦除后写的动作,没有擦除和写分开的函数,这样的操作是否可行?可行的话,可否帮写一个单独写一个flash row size和单独擦除一个flash row size的函数?客户需要用到这样的操作?

           2:flash操作有没有整个芯片擦除的操作?

        • 1. Re: Flash write API
          bob.marlowe

          When you post your question in English language there will be quite more people to help you.

           

          Bob

          • 2. Re: Flash write API
            e.pratt_1639216

            1. I haven't looked at the code specifically, but there should be separate erase/write functions for what you are asking. If not, then it is internal to the cypress API library.

            2. There is a sequence of programming impulses that will erase the entire chip, but that is meant more for an external programmer. Perhaps utilizing an external programmer would be the best for achieving your goal?

            • 3. Re: Flash write API
              xzng

              与PSoC3/5 不同,PSoC4 的 FlashWriteRow() API 擦除和烧写是无法分开的,因为固化在 SROM 中的调用函数就是这样定义的,先擦除后烧写。 如果客户需要重新烧写某一行的部分内容的话,可以先把该行的数据读出,更换部分内容然后再执行行烧写动作。

               

              SROM 为FLASH 操作定义了 EraseAll() 函数,但是该动作只能由外部通过 DAP 接口来操作,芯片 FW 层是无法支持这个动作的。因为 FALSH EraseALL 不仅包括清除 FLASH 本身的数据,还包括一些 protection 信息。

               

              Note: 目前这个论坛国外的活动用户比国内多,使用英文提问效率会更高一些。如果有困难,使用中文也是 OK 的,只是参与的人数少一些。

              1 of 1 people found this helpful
              • 4. Re: Flash write API
                769482734_1650581

                Hi All:

                     I found that the function of "uint8 CyEnterCriticalSection(void);void  CyExitCriticalSection(uint8 savedIntrStatus);" are called by the "CySysFlashWriteRow".what are they used for ?And the same time ,is the "CySysFlashWriteRow" function  a blocking function?

                • 5. Re: Flash write API
                  ring

                  uint8 CyEnterCriticalSection(void); The function prevents interrupts being executed by setting PRIMASK register and

                  returns previous state.

                  void  CyExitCriticalSection(uint8 savedIntrStatus);The function restores the interrupt state as it was before CyEnterCriticalSection()

                  function call.

                  Yes, it is a blocking function, the chip only execute next step until the flash finished write.

                  1 of 1 people found this helpful