Invalidating the Data Cache before Enabling it makes some peripherals not work

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Invalidating the Data Cache before Enabling it makes some peripherals not work

跳至解决方案
570 次查看
MohamedSalah
Contributor II

Hi Experts I am using RTD 4.0.0 For S32K312 

  • I am working on a project that is configuring ADC to work in CTU and get triggered by BCTU Module
  • ADC,BCTU PWM all the system works fine.
  • I want to Enable Caching to increase the performance of the System 
  • The issue happens when I invalidate the Data cache before using it As suggested by the MCL_UserManual 

MohamedSalah_0-1760639518727.png

MohamedSalah_1-1760639644647.png

  • When I call the api [Mcl_CacheInvalidate()] for the Data cache 
  • The : - BCTU Stops working -ADC Stops working -Some PWM Signals stopped working 
  • While If I comment the Call -> Everything works fine 

MohamedSalah_2-1760639760576.png

  • I thought maybe the Invalidation steps messes with some data related to the peripherals
  • I made sure the MPU is enabled and the peripherals region are added to a Non Cacheable memory region but the issue still the same 
  • I even explictly added some flags and variables related to the BCTU ISR in No Cacheable section as a test but no difference happens 
  • I looked the target Reference Manual and the ERRATA but found no help regarding this issue 
  • Also checked other Posts in the community but found no case similar to mine 
  • I even checked other examples related to the DMA and MPU hoping to find some hint about the Cache Enable but couldn't reach anything 

The Question is : 

-What could be the reason for this ?

-is the Invalidation of the Data Cache needed ?

-Is this the valid way to enable cache in S32K312 ?

 

Best Regards, 

Mohamed Moghazy 

 

0 项奖励
回复
1 解答
484 次查看
MohamedSalah
Contributor II

Hi @danielmartynek , 

Thanks for you reply 

Yesterday I made more debugging in the SW , turns out Cache and MPU are already enabled by the startup code 

inside the file [system.c] , it checks for some macros to either enable or not [I-Cache, D-Cache , MPU]

MohamedSalah_0-1761048827484.pngMohamedSalah_1-1761048866987.png

And those macros are already defined in the project settings 

MohamedSalah_2-1761049333877.png

- I think the issue when I was calling [Mcl_CacheInvalidate] there are already data added to the data cache and this results removing these data which affects the peripherals 

-To test the Theory:

  • I removed the data and instruction cache enable macros from the project settings 
  • left the MPU to be enabled by the startup code and removed the MPU Configuration from the MCL 
  • made sure that the startup code is not enabling the cache 
  • Enabled the cache support in the Mcl Configuration
  • and call the functions [Mcl_CacheInvalidate] and [Mcl_CacheEnable] as before right after the Mcl_Init()
  • Everything works fine and the issues with the [BCTU,PWM and ADC] are solved !!!

New Question: In your opinion would it be better to let the startup code enable and initialize the cache and MPU or should disable its handling and do this using the MCL Module , given that my project is running a PMSM Motor using FOC [Using NXP Application note on the topic:AN13767_3-phase_Sensorless_PMSM_Motor_Control_Kit_with_S32K344] ?

Best Regards,

Mohamed Salah

在原帖中查看解决方案

0 项奖励
回复
4 回复数
485 次查看
MohamedSalah
Contributor II

Hi @danielmartynek , 

Thanks for you reply 

Yesterday I made more debugging in the SW , turns out Cache and MPU are already enabled by the startup code 

inside the file [system.c] , it checks for some macros to either enable or not [I-Cache, D-Cache , MPU]

MohamedSalah_0-1761048827484.pngMohamedSalah_1-1761048866987.png

And those macros are already defined in the project settings 

MohamedSalah_2-1761049333877.png

- I think the issue when I was calling [Mcl_CacheInvalidate] there are already data added to the data cache and this results removing these data which affects the peripherals 

-To test the Theory:

  • I removed the data and instruction cache enable macros from the project settings 
  • left the MPU to be enabled by the startup code and removed the MPU Configuration from the MCL 
  • made sure that the startup code is not enabling the cache 
  • Enabled the cache support in the Mcl Configuration
  • and call the functions [Mcl_CacheInvalidate] and [Mcl_CacheEnable] as before right after the Mcl_Init()
  • Everything works fine and the issues with the [BCTU,PWM and ADC] are solved !!!

New Question: In your opinion would it be better to let the startup code enable and initialize the cache and MPU or should disable its handling and do this using the MCL Module , given that my project is running a PMSM Motor using FOC [Using NXP Application note on the topic:AN13767_3-phase_Sensorless_PMSM_Motor_Control_Kit_with_S32K344] ?

Best Regards,

Mohamed Salah

0 项奖励
回复
462 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Mohamed,

Thank for the update, your observation makes sense.

If the MPU and cache are configured by the MCAL Platform and MCL drivers immediately after startup - before any real-time peripherals begin operation - there should be no issues, especially if the MPU settings in both the startup code and the application are consistent.

 

Regards,

Daniel

454 次查看
MohamedSalah
Contributor II

Yeah Agree with you 

Thanks for your fast replies 

Have a nice day 

0 项奖励
回复
506 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @MohamedSalah,

Are you configuring the MPU using RTD, or is it being set up during startup code execution?

Could you share your MPU region configuration?

When exactly are you calling Mcl_CacheInvalidate() and enabling the cache? Is it during MCU initialization or later during runtime?

Are you using DMA with ADC, BCTU, or PWM? If yes, are the DMA buffers placed in non-cacheable memory regions?

 

Regards,

Daniel

 

 

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2187732%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%90%AF%E7%94%A8%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E5%89%8D%E4%BD%BF%E5%85%B6%E5%A4%B1%E6%95%88%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%9F%90%E4%BA%9B%E5%A4%96%E8%AE%BE%E6%97%A0%E6%B3%95%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2187732%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%B8%93%E5%AE%B6%E4%BB%AC%E5%A5%BD%EF%BC%8C%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%20RTD%204.0.0%E3%80%82%E7%94%A8%E4%BA%8E%20S32K312%20%3C%2FP%3E%3CUL%3E%3CLI%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E5%BC%80%E5%8F%91%E4%B8%80%E4%B8%AA%E5%B0%86%20ADC%20%E9%85%8D%E7%BD%AE%E4%B8%BA%E5%9C%A8%20CTU%20%E4%B8%AD%E8%BF%90%E8%A1%8C%E5%B9%B6%E7%94%B1%20BCTU%20%E6%A8%A1%E5%9D%97%E8%A7%A6%E5%8F%91%E7%9A%84%E9%A1%B9%E7%9B%AE%3C%2FLI%3E%3CLI%3EADC%E3%80%81BCTU%20PWM%20%E6%89%80%E6%9C%89%E7%B3%BB%E7%BB%9F%E5%B7%A5%E4%BD%9C%E6%AD%A3%E5%B8%B8%E3%80%82%3C%2FLI%3E%3CLI%3E%E6%88%91%E6%83%B3%E5%90%AF%E7%94%A8%E7%BC%93%E5%AD%98%E4%BB%A5%E6%8F%90%E9%AB%98%E7%B3%BB%E7%BB%9F%E6%80%A7%E8%83%BD%20%3C%2FLI%3E%3CLI%3E%E6%8C%89%E7%85%A7%20MCL_UserManual%20%E7%9A%84%E5%BB%BA%E8%AE%AE%EF%BC%8C%E5%BD%93%E6%88%91%E5%9C%A8%E4%BD%BF%E7%94%A8%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E4%B9%8B%E5%89%8D%E4%BD%BF%E5%85%B6%E5%A4%B1%E6%95%88%E6%97%B6%EF%BC%8C%E9%97%AE%E9%A2%98%E5%B0%B1%E4%BC%9A%E5%87%BA%E7%8E%B0%E3%80%82%20%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedSalah_0-1760639518727.png%22%20style%3D%22width%3A%20520px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MohamedSalah_0-1760639518727.png%22%20style%3D%22width%3A%20520px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361236iB6CAAA2D94C9441D%2Fimage-dimensions%2F520x199%3Fv%3Dv2%22%20width%3D%22520%22%20height%3D%22199%22%20role%3D%22button%22%20title%3D%22MohamedSalah_0-1760639518727.png%22%20alt%3D%22MohamedSalah_0-1760639518727.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedSalah_1-1760639644647.png%22%20style%3D%22width%3A%20438px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MohamedSalah_1-1760639644647.png%22%20style%3D%22width%3A%20438px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361237i898B1F23E64D9E68%2Fimage-dimensions%2F438x138%3Fv%3Dv2%22%20width%3D%22438%22%20height%3D%22138%22%20role%3D%22button%22%20title%3D%22MohamedSalah_1-1760639644647.png%22%20alt%3D%22MohamedSalah_1-1760639644647.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%E5%BD%93%E6%88%91%E8%B0%83%E7%94%A8%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E7%9A%84%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%5BMcl_CacheInvalidate()%5D%E6%97%B6%20%3C%2FLI%3E%3CLI%3EBCTU%20%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C%20-ADC%20%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C%20-%E9%83%A8%E5%88%86%20PWM%20%E4%BF%A1%E5%8F%B7%E5%81%9C%E6%AD%A2%E5%B7%A5%E4%BD%9C%20%3C%2FLI%3E%3CLI%3E%E8%80%8C%E5%A6%82%E6%9E%9C%E6%88%91%E6%B3%A8%E9%87%8A%E5%91%BC%E5%8F%AB%20-%26gt%3B%20%E5%88%99%E4%B8%80%E5%88%87%E6%AD%A3%E5%B8%B8%20%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedSalah_2-1760639760576.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MohamedSalah_2-1760639760576.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361238i80CC486410985C31%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedSalah_2-1760639760576.png%22%20alt%3D%22MohamedSalah_2-1760639760576.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%E6%88%91%E6%83%B3%E5%8F%AF%E8%83%BD%E6%98%AF%20%22%E6%97%A0%E6%95%88%20%22%E6%AD%A5%E9%AA%A4%E6%89%B0%E4%B9%B1%E4%BA%86%E4%B8%8E%E5%A4%96%E5%9B%B4%E8%AE%BE%E5%A4%87%E6%9C%89%E5%85%B3%E7%9A%84%E6%9F%90%E4%BA%9B%E6%95%B0%E6%8D%AE%3C%2FLI%3E%3CLI%3E%E6%88%91%E7%A1%AE%E4%BF%9D%20MPU%20%E5%B7%B2%E5%90%AF%E7%94%A8%EF%BC%8C%E5%A4%96%E8%AE%BE%E5%8C%BA%E5%9F%9F%E5%B7%B2%E6%B7%BB%E5%8A%A0%E5%88%B0%E9%9D%9E%E9%AB%98%E9%80%9F%E7%BC%93%E5%AD%98%E5%86%85%E5%AD%98%E5%8C%BA%E5%9F%9F%EF%BC%8C%E4%BD%86%E9%97%AE%E9%A2%98%E4%BE%9D%E7%84%B6%E5%A6%82%E6%95%85%20%3C%2FLI%3E%3CLI%3E%E6%88%91%E7%94%9A%E8%87%B3%E5%9C%A8%20%22%E6%97%A0%E7%BC%93%E5%AD%98%20%22%E9%83%A8%E5%88%86%E6%98%8E%E7%A1%AE%E6%B7%BB%E5%8A%A0%E4%BA%86%E4%B8%80%E4%BA%9B%E4%B8%8E%20BCTU%20ISR%20%E7%9B%B8%E5%85%B3%E7%9A%84%E6%A0%87%E5%BF%97%E5%92%8C%E5%8F%98%E9%87%8F%EF%BC%8C%E4%BB%A5%E8%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2%98%E6%98%AF%20%EF%BC%9A%20%3C%2FP%3E%3CP%3E-%E5%8E%9F%E5%9B%A0%E4%BD%95%E5%9C%A8%EF%BC%9F%3C%2FP%3E%3CP%3E-%E6%98%AF%E5%90%A6%E9%9C%80%E8%A6%81%E6%92%A4%E9%94%80%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%EF%BC%9F%3C%2FP%3E%3CP%3E-%E8%BF%99%E6%98%AF%E5%90%A6%E6%98%AF%E5%9C%A8%20S32K312%20%E4%B8%AD%E5%90%AF%E7%94%A8%E7%BC%93%E5%AD%98%E7%9A%84%E6%9C%89%E6%95%88%E6%96%B9%E6%B3%95%EF%BC%9F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E8%87%B4%E4%BB%A5%E6%9C%80%E5%B4%87%E9%AB%98%E7%9A%84%E6%95%AC%E6%84%8F%20%3C%2FP%3E%3CP%3E%E7%A9%86%E7%BD%95%E9%BB%98%E5%BE%B7-%E8%8E%AB%E5%8A%A0%E5%85%B9%20%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190788%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Invalidating%20the%20Data%20Cache%20before%20Enabling%20it%20makes%20some%20peripherals%20not%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190788%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%90%8C%E6%84%8F%E4%BD%A0%E7%9A%84%E8%A7%82%E7%82%B9%20%3C%2FP%3E%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%BF%AB%E9%80%9F%E5%9B%9E%E5%A4%8D%20%3C%2FP%3E%3CP%3E%E7%A5%9D%E6%82%A8%E6%84%89%E5%BF%AB%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190586%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Invalidating%20the%20Data%20Cache%20before%20Enabling%20it%20makes%20some%20peripherals%20not%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190586%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E7%A9%86%E7%BD%95%E9%BB%98%E5%BE%B7%E3%80%81%3C%2FP%3E%0A%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E6%9B%B4%E6%96%B0%EF%BC%8C%E6%82%A8%E7%9A%84%E8%A7%82%E5%AF%9F%E6%98%AF%E6%9C%89%E6%84%9F%E7%9F%A5%E7%9A%84%E3%80%82%3C%2FP%3E%0A%3CP%3E%E5%A6%82%E6%9E%9C%20MCAL%20%E5%B9%B3%E5%8F%B0%E5%92%8C%20MCL%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E5%9C%A8%E5%90%AF%E5%8A%A8%E5%90%8E%EF%BC%88%E4%BB%BB%E4%BD%95%E5%AE%9E%E6%97%B6%E5%A4%96%E8%AE%BE%E5%BC%80%E5%A7%8B%E8%BF%90%E8%A1%8C%E4%B9%8B%E5%89%8D%EF%BC%89%E7%AB%8B%E5%8D%B3%E5%AF%B9%20MPU%20%E5%92%8C%E9%AB%98%E9%80%9F%E7%BC%93%E5%AD%98%E8%BF%9B%E8%A1%8C%E9%85%8D%E7%BD%AE%EF%BC%8C%E5%BA%94%E8%AF%A5%E4%B8%8D%E4%BC%9A%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98%EF%BC%8C%E5%B0%A4%E5%85%B6%E6%98%AF%E5%9C%A8%E5%90%AF%E5%8A%A8%E4%BB%A3%E7%A0%81%E5%92%8C%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E7%9A%84%20MPU%20%E8%AE%BE%E7%BD%AE%E4%BF%9D%E6%8C%81%E4%B8%80%E8%87%B4%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E3%80%82%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3C%2FP%3E%0A%3CP%3E%E4%B8%B9%E5%B0%BC%E5%B0%94%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189967%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Invalidating%20the%20Data%20Cache%20before%20Enabling%20it%20makes%20some%20peripherals%20not%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189967%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E6%88%91%E6%98%AF%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%E3%80%81%20%3C%2FP%3E%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%9B%9E%E5%A4%8D%20%3C%2FP%3E%3CP%3E%E6%98%A8%E5%A4%A9%E6%88%91%E5%AF%B9%E8%BD%AF%E4%BB%B6%E8%BF%9B%E8%A1%8C%E4%BA%86%E6%9B%B4%E5%A4%9A%E8%B0%83%E8%AF%95%EF%BC%8C%E7%BB%93%E6%9E%9C%E5%8F%91%E7%8E%B0%E5%90%AF%E5%8A%A8%E4%BB%A3%E7%A0%81%E5%B7%B2%E7%BB%8F%E5%90%AF%E7%94%A8%E4%BA%86%E9%AB%98%E9%80%9F%E7%BC%93%E5%AD%98%E5%92%8C%20MPU%E3%80%82%20%3C%2FP%3E%3CP%3E%E6%96%87%E4%BB%B6%5Bsystem.c%5D%E4%B8%AD%EF%BC%8C%E5%AE%83%E4%BC%9A%E6%A3%80%E6%9F%A5%E6%9F%90%E4%BA%9B%E5%AE%8F%E6%98%AF%E5%90%A6%E5%90%AF%E7%94%A8%20%5B%E6%8C%87%E4%BB%A4%E7%BC%93%E5%AD%98%E3%80%81%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E3%80%81MPU%5D%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedSalah_0-1761048827484.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MohamedSalah_0-1761048827484.png%22%20style%3D%22width%3A%20316px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361869i7D3DF14659FD3F5A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedSalah_0-1761048827484.png%22%20alt%3D%22MohamedSalah_0-1761048827484.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedSalah_1-1761048866987.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MohamedSalah_1-1761048866987.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361870iBCFB6EED7C661946%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedSalah_1-1761048866987.png%22%20alt%3D%22MohamedSalah_1-1761048866987.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E8%BF%99%E4%BA%9B%E5%AE%8F%E5%B7%B2%E5%9C%A8%E9%A1%B9%E7%9B%AE%E8%AE%BE%E7%BD%AE%E4%B8%AD%E5%AE%9A%E4%B9%89%20%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MohamedSalah_2-1761049333877.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MohamedSalah_2-1761049333877.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361871iD97A598B6B319D8D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MohamedSalah_2-1761049333877.png%22%20alt%3D%22MohamedSalah_2-1761049333877.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E-%20%E6%88%91%E8%AE%A4%E4%B8%BA%E9%97%AE%E9%A2%98%E5%87%BA%E5%9C%A8%E8%B0%83%E7%94%A8%20%5BMcl_CacheInvalidate%5D%20%E6%97%B6%EF%BC%8C%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E4%B8%AD%E5%B7%B2%E7%BB%8F%E6%B7%BB%E5%8A%A0%E4%BA%86%E6%95%B0%E6%8D%AE%EF%BC%8C%E7%BB%93%E6%9E%9C%E5%88%A0%E9%99%A4%E4%BA%86%E8%BF%99%E4%BA%9B%E6%95%B0%E6%8D%AE%EF%BC%8C%E4%BB%8E%E8%80%8C%E5%BD%B1%E5%93%8D%E4%BA%86%E5%A4%96%E8%AE%BE%E3%80%82%20%3C%2FP%3E%3CP%3E-%E6%B5%8B%E8%AF%95%E7%90%86%E8%AE%BA%EF%BC%9A%3C%2FP%3E%3CUL%3E%3CLI%3E%E6%88%91%E4%BB%8E%E9%A1%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9%97%AE%E9%A2%98%3C%2FSTRONG%3E%EF%BC%9A%E5%9C%A8%E4%BD%A0%E7%9C%8B%E6%9D%A5%EF%BC%8C%E9%89%B4%E4%BA%8E%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20FOC%20%E8%BF%90%E8%A1%8C%20PMSM%20%E7%94%B5%E6%9C%BA%EF%BC%8C%E9%82%A3%E4%B9%88%E8%AE%A9%E5%90%AF%E5%8A%A8%E4%BB%A3%E7%A0%81%E5%90%AF%E7%94%A8%E5%B9%B6%E5%88%9D%E5%A7%8B%E5%8C%96%E7%BC%93%E5%AD%98%E5%92%8C%20MPU%EF%BC%8C%E8%BF%98%E6%98%AF%E5%BA%94%E8%AF%A5%E7%A6%81%E7%94%A8%E5%85%B6%E5%A4%84%E7%90%86%E7%84%B6%E5%90%8E%E4%BD%BF%E7%94%A8%20MCL%20%E6%A8%A1%E5%9D%97%E6%89%A7%E8%A1%8C%E6%AD%A4%E6%93%8D%E4%BD%9C%20%5B%E4%BD%BF%E7%94%A8%E6%81%A9%E6%99%BA%E6%B5%A6%E5%BA%94%E7%94%A8%E7%AC%94%E8%AE%B0%EF%BC%9Aan13767_3-Phase_Sensorless_pmsm_motor_control_kit_with_s32K344%5D%EF%BC%9F%3C%2FP%3E%3CP%3E%E9%A1%BA%E7%A5%9D%E5%95%86%E7%A5%BA%EF%BC%81%3C%2FP%3E%3CP%3E%E7%A9%86%E7%BD%95%E9%BB%98%E5%BE%B7-%E8%90%A8%E6%8B%89%E8%B5%AB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189127%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Invalidating%20the%20Data%20Cache%20before%20Enabling%20it%20makes%20some%20peripherals%20not%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189127%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F209398%22%20target%3D%22_blank%22%3E%40MohamedSalah%3C%2FA%3E%E3%80%81%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E6%98%AF%E5%9C%A8%E4%BD%BF%E7%94%A8%20RTD%20%E9%85%8D%E7%BD%AE%20MPU%EF%BC%8C%E8%BF%98%E6%98%AF%E5%9C%A8%E5%90%AF%E5%8A%A8%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%9C%9F%E9%97%B4%E5%AE%89%E8%A3%85%E7%9A%84%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%E8%83%BD%E5%90%A6%E5%88%86%E4%BA%AB%E4%B8%80%E4%B8%8B%E6%82%A8%E7%9A%84%20MPU%20%E5%8C%BA%E5%9F%9F%E9%85%8D%E7%BD%AE%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E5%88%B0%E5%BA%95%E6%98%AF%E4%BB%80%E4%B9%88%E6%97%B6%E5%80%99%E8%B0%83%E7%94%A8%3CCODE%20translate%3D%22no%22%3EMcl_CacheInvalidate()%3C%2FCODE%3E%20%E5%B9%B6%E5%90%AF%E7%94%A8%E7%BC%93%E5%AD%98%E7%9A%84%EF%BC%9F%20%E6%98%AF%E5%9C%A8%20MCU%20%E5%88%9D%E5%A7%8B%E5%8C%96%E6%97%B6%E8%BF%98%E6%98%AF%E5%9C%A8%E8%BF%90%E8%A1%8C%E6%97%B6%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E6%98%AF%E5%9C%A8%E4%BD%BF%E7%94%A8%20ADC%E3%80%81BCTU%20%E8%BF%98%E6%98%AF%20PWM%20%E7%9A%84%20DMA%EF%BC%9F%20%E5%A6%82%E6%9E%9C%E5%9B%9E%E7%AD%94%E4%B8%BA%20%22%E6%98%AF%22%EF%BC%8C%E9%82%A3%E4%B9%88%20DMA%20%E7%BC%93%E5%86%B2%E5%8C%BA%E6%98%AF%E5%90%A6%E4%BD%8D%E4%BA%8E%E9%9D%9E%E9%AB%98%E9%80%9F%E7%BC%93%E5%AD%98%E5%86%85%E5%AD%98%E5%8C%BA%E5%9F%9F%EF%BC%9F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3C%2FP%3E%0A%3CP%3E%E4%B8%B9%E5%B0%BC%E5%B0%94%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E