Data cache could not be invalidated after install HSE Firmware

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Data cache could not be invalidated after install HSE Firmware

1,540 Views
zyt
Contributor III

The data cache can be invalidated by address (through 0xE000EF5C) base the ARM reference manual.

zyt_0-1727255438282.png

like using command "STR R0,[R4,#0xF5C]", where R0 stores the flash address, and R4 stores address 0xE000E000.

It works well in plain S32K3 chip, the value of flash address changed from its real value after execute that command.

But after install HSE firmware, the value not changed, that means data cache doesn't invalidated.

What the reason for that? Is there any conflict between HSE and data cache?

 

0 Kudos
Reply
1 Reply

1,535 Views
jennie258fitz
Contributor II

When working with ARM-based microcontrollers like the S32K3, issues related to data cache invalidation after installing HSE firmware can arise from several factors. Here SpotifyPie are a few potential reasons why the cache invalidation might not be working as expected after the firmware installation: 

1. Firmware Configuration: The HSE firmware may have modified cache settings or disabled the data cache. Check the firmware documentation or initialization code to ensure that the cache is enabled and configured correctly.

2. Cache Control: Ensure that the cache control registers are correctly configured after the HSE firmware installation. Sometimes firmware can reset or change configurations that affect cache behavior.

3. Memory Region Attributes: The memory region where the flash address resides might have different attributes after HSE installation. Ensure that the memory regions are set up with the appropriate attributes (e.g., caching policies) to allow proper cache behavior.

4. Data Synchronization: After modifying cache-related settings or memory regions, it may be necessary to perform additional synchronization operations, like data memory barrier (DMB) or data synchronization barrier (DSB), to ensure all memory operations are completed before proceeding.

5. Interrupt Handling: If the HSE firmware has altered interrupt handling, ensure that the cache invalidation command is not being interrupted or affected by other operations.

6. Access Permissions: The HSE firmware might have altered access permissions for the memory regions, which could prevent the cache from being invalidated correctly.

7. Cache Policy: The HSE firmware might have implemented a different cache policy (e.g., write-back vs. write-through) that changes how the cache interacts with memory. Verify the cache policies used in both plain S32K3 and HSE configurations.

To troubleshoot the issue:

- Review HSE Documentation: Check for any notes on cache behavior or configurations in the HSE firmware documentation.

- Debugging: Use debugging tools to step through the cache invalidation process and monitor register states before and after the command execution.

- Compare Configurations: Compare the memory and cache configurations before and after installing the HSE firmware to identify any discrepancies.

0 Kudos
Reply