Write User SFlash interferes with SW Tx UART

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.
Anonymous
Not applicable

Dear all,

   

I noticed using the very useful code snippet WriteUserSFlash for writing data to user flash prevents SW TX UART from working.

   

I understood that writing to user flash requires changing the system clock and SW TX UART requires a call to CyDelayFreq after this clock modification. But I do not know what to provide as a parameter, I tried 0 as this is the original value but it did not solve the problem.

   

I also imagine that as the system clock is restored after writing, thus there might be no impact as long as one does not use the SW TX UART component when the system clock is changed.

   

I attached a sample test derived from the original code snippet to demonstrate the issue on BLE pioneer kit.

   

Is there some information I missed that helps getting those two fellows working together ?

   

Thanks a lot for your help,

   

Maximilien.

0 Likes
1 Solution
Anonymous
Not applicable

Hi Maximilien,

   

We have seen some issues with that example project, especially when Low CPU frequencies are used. There are some issue in recovering the clocks back (SFLASH writes changes IMO frequencies )  after writing to SFLASH which affects the operation of SW Tx UART. Initially, we did not have SFLASH Write API as part of Creator boot code. Now we have it.

   

Please use the API CySysSFlashWriteUserRow. This API works fine even with low CPU frequencies . We also have example project for the same (SFlash_Example) as part of Creator Example projects.

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

Hi Maximilien,

   

We have seen some issues with that example project, especially when Low CPU frequencies are used. There are some issue in recovering the clocks back (SFLASH writes changes IMO frequencies )  after writing to SFLASH which affects the operation of SW Tx UART. Initially, we did not have SFLASH Write API as part of Creator boot code. Now we have it.

   

Please use the API CySysSFlashWriteUserRow. This API works fine even with low CPU frequencies . We also have example project for the same (SFlash_Example) as part of Creator Example projects.

0 Likes
Anonymous
Not applicable

Hi,

   

The actual CPU clock frequency in Hertz is passed as a parameter to this function. For example CyDelayFreq (12000000);

   

Regards,

   

- Madhu Sudhan

0 Likes
Anonymous
Not applicable

Thanks a lot for your helpful answers !

   

Correct use of CyDelayFreq did not fix the issue.

   

Using CySysSFlashWriteUserRow solved the problem ; things are now very smooth 🙂

   

Thanks again and all my best wishes for 2017 !

   

Maximilien.

0 Likes