fsl_iap Erase/Program checks clock in 25.6

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

fsl_iap Erase/Program checks clock in 25.6

332 次查看
Folkert
Contributor I

With an update of the fsl-library to 25.6, I noticed that in fsl_iap.c the erase and program functions have a check on the clock being higher than 100MHz. 

Here the kCLOCK_CoreSysClk is checked, which is the main_clk in fig 4 in UM11126, page 43. I think this should be checked against kCLOCK_BusClk, which is the actual clock to the CPU.

Kind regards,

Folkert

标签 (1)
0 项奖励
回复
3 回复数

291 次查看
Folkert
Contributor I

Dear @Harry_Zhang 

Thank you for your answer.

We use the LPC55S69 with the clock connected to PLL0, which runs at 150MHz and normally, we have kCLOCK_DivAhbClk set to 1. When we want to write to flash, we set kCLOCK_DivAhbClk to 2 to have the CPU running at 75MHz, which is functional. 
In this case, the fsl_iap functions should check on kCLOCK_BusClk, because then it differs from kCLOCK_CoreSysClk.

Kind regards,

Folkert

 

 

0 项奖励
回复

276 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @Folkert 

Yes, you are right.

When we set kCLOCK_DivAhbClk  to 2,

 the fsl_iap functions should check on kCLOCK_BusClk.

BR

Harry

0 项奖励
回复

302 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @Folkert 

I checked this demo.

Harry_Zhang_0-1758622918461.png

I found that 

CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false);

So the  kCLOCK_BusClk is the same with the  kCLOCK_CoreSysClk.

And i print them. they are same.

You can tested it.

BR

Harry

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2173433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Efsl_iap%20%E6%93%A6%E9%99%A4%2F%E7%BC%96%E7%A8%8B%E6%A3%80%E6%9F%A5%2025.6%20%E4%B8%AD%E7%9A%84%E6%97%B6%E9%92%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%B0%86fsl-library%E6%9B%B4%E6%96%B0%E5%88%B025.6%E5%90%8E%EF%BC%8C%E6%88%91%E6%B3%A8%E6%84%8F%E5%88%B0fsl_iap.c%E4%B8%AD%E7%9A%84%E6%93%A6%E9%99%A4%E5%92%8C%E7%BC%96%E7%A8%8B%E5%8A%9F%E8%83%BD%E9%9C%80%E8%A6%81%E6%A3%80%E6%9F%A5%E6%97%B6%E9%92%9F%E6%98%AF%E5%90%A6%E9%AB%98%E4%BA%8E100MHz%E3%80%82%20%3C%2FP%3E%3CP%3E%E8%BF%99%E9%87%8C%E8%A6%81%E6%A3%80%E6%9F%A5%20kCLOCK_CoreSysClk%EF%BC%8C%E5%8D%B3%20UM11126%20%E7%AC%AC%2043%20%E9%A1%B5%E5%9B%BE%204%20%E4%B8%AD%E7%9A%84%20main_clk%E3%80%82%E6%88%91%E8%AE%A4%E4%B8%BA%E8%BF%99%E5%BA%94%E8%AF%A5%E4%B8%8E%20kCLOCK_BusClk%20%E8%BF%9B%E8%A1%8C%E6%A0%B8%E5%AF%B9%EF%BC%8C%E5%90%8E%E8%80%85%E6%98%AF%20CPU%20%E7%9A%84%E5%AE%9E%E9%99%85%E6%97%B6%E9%92%9F%E3%80%82%3C%2FP%3E%3CP%3E%E6%AD%A4%E8%87%B4%E6%95%AC%E7%A4%BC%EF%BC%8C%3C%2FP%3E%3CP%3E%E7%A6%8F%E5%B0%94%E5%85%8B%E7%89%B9%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2173433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ELPC55xx%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2175513%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20fsl_iap%20Erase%2FProgram%20checks%20clock%20in%2025.6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2175513%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F232865%22%20target%3D%22_blank%22%3E%40Folkert%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E6%98%AF%E7%9A%84%EF%BC%8C%E4%BD%A0%E8%AF%B4%E5%BE%97%E5%AF%B9%E3%80%82%3C%2FP%3E%0A%3CP%3E%E5%BD%93%E6%88%91%E4%BB%AC%E5%B0%86%20kCLOCK_DivAhbClk%20%E8%AE%BE%E7%BD%AE%E4%B8%BA%202%20%E6%97%B6%E3%80%81%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Efsl_iap%20%E5%87%BD%E6%95%B0%E5%BA%94%E6%A3%80%E6%9F%A5%20kCLOCK_BusClk%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBR%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%E5%93%88%E5%88%A9%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2174929%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20fsl_iap%20Erase%2FProgram%20checks%20clock%20in%2025.6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2174929%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BA%B2%E7%88%B1%E7%9A%84%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229957%22%20target%3D%22_blank%22%3E%40Harry_Zhang%3C%2FA%3E%3C%2FP%3E%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E8%A7%A3%E7%AD%94%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E4%BB%AC%E4%BD%BF%E7%94%A8%E7%9A%84%20LPC55S69%20%E7%9A%84%E6%97%B6%E9%92%9F%E8%BF%9E%E6%8E%A5%E5%88%B0%20PLL0%EF%BC%8C%E5%85%B6%E9%A2%91%E7%8E%87%E4%B8%BA%20150MHz%EF%BC%8C%E9%80%9A%E5%B8%B8%E6%88%91%E4%BB%AC%E5%B0%86%3CSPAN%3EkCLOCK_DivAhbClk%3C%2FSPAN%3E%E8%AE%BE%E7%BD%AE%E4%B8%BA%201%E3%80%82%E5%BD%93%E6%88%91%E4%BB%AC%E8%A6%81%E5%90%91%E9%97%AA%E5%AD%98%E5%86%99%E5%85%A5%E6%95%B0%E6%8D%AE%E6%97%B6%EF%BC%8C%E6%88%91%E4%BB%AC%E5%B0%86%3CSPAN%3EkCLOCK_DivAhbClk%3C%2FSPAN%3E%E8%AE%BE%E7%BD%AE%E4%B8%BA%202%EF%BC%8C%E4%BD%BF%20CPU%20%E4%BB%A5%2075MHz%20%E7%9A%84%E9%A2%91%E7%8E%87%E8%BF%90%E8%A1%8C%E3%80%82%20%3CBR%20%2F%3E%E5%9C%A8%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8Cfsl_iap%20%E5%87%BD%E6%95%B0%E5%BA%94%E6%A3%80%E6%9F%A5%20kCLOCK_BusClk%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%AE%83%E4%B8%8E%20kCLOCK_CoreSysClk%20%E4%B8%8D%E5%90%8C%E3%80%82%3C%2FP%3E%3CP%3E%E6%AD%A4%E8%87%B4%E6%95%AC%E7%A4%BC%EF%BC%8C%3C%2FP%3E%3CP%3E%E7%A6%8F%E5%B0%94%E5%85%8B%E7%89%B9%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2174243%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20fsl_iap%20Erase%2FProgram%20checks%20clock%20in%2025.6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2174243%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F232865%22%20target%3D%22_blank%22%3E%40Folkert%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E6%88%91%E7%9C%8B%E8%BF%87%E8%BF%99%E4%B8%AA%E6%BC%94%E7%A4%BA%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_0-1758622918461.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_0-1758622918461.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F358160i077741BFAAFCBDAC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_0-1758622918461.png%22%20alt%3D%22Harry_Zhang_0-1758622918461.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E6%88%91%E5%8F%91%E7%8E%B0%20%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3ECLOCK_SetClkDiv(kCLOCK_DivAhbClk%2C%201U%2C%20false)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E5%9B%A0%E6%AD%A4%EF%BC%8CkCLOCK_BusClk%20%E4%B8%8E%20kCLOCK_CoreSysClk%20%E7%9B%B8%E5%90%8C%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%88%91%E6%8A%8A%E5%AE%83%E4%BB%AC%E6%89%93%E5%8D%B0%E5%87%BA%E6%9D%A5%E3%80%82%E5%AE%83%E4%BB%AC%E6%98%AF%E4%B8%80%E6%A0%B7%E7%9A%84%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E5%8F%AF%E4%BB%A5%E8%BF%9B%E8%A1%8C%E6%B5%8B%E8%AF%95%E3%80%82%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3E%E5%93%88%E5%88%A9%3C%2FP%3E%3C%2FLINGO-BODY%3E