fsl_iap Erase/Program checks clock in 25.6

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

fsl_iap Erase/Program checks clock in 25.6

331件の閲覧回数
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 返答(返信)

290件の閲覧回数
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 件の賞賛
返信

275件の閲覧回数
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 件の賞賛
返信

301件の閲覧回数
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%B6%88%E5%8E%BB%2F%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%AF%2025.6%20%E3%81%A7%E5%AE%8C%E4%BA%86%E3%81%97%E3%81%BE%E3%81%99%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Efsl%20%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%82%92%2025.6%20%E3%81%AB%E3%82%A2%E3%83%83%E3%83%97%E3%83%87%E3%83%BC%E3%83%88%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81fsl_iap.c%20%E3%81%AE%E6%B6%88%E5%8E%BB%E3%81%8A%E3%82%88%E3%81%B3%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E9%96%A2%E6%95%B0%E3%81%AB%E3%82%AF%E3%83%AD%E3%83%83%E3%82%AF%E3%81%8C%20100%20MHz%20%E3%82%92%E8%B6%85%E3%81%88%E3%81%A6%E3%81%84%E3%82%8B%E3%81%8B%E3%81%A9%E3%81%86%E3%81%8B%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%8C%E3%81%82%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AB%E6%B0%97%E4%BB%98%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%E3%81%93%E3%81%93%E3%81%A7%E3%80%81kCLOCK_CoreSysClk%20%E3%81%8C%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81UM11126%20%E3%81%AE%2043%20%E3%83%9A%E3%83%BC%E3%82%B8%E3%81%AE%E5%9B%B3%204%20%E3%81%AB%E3%81%82%E3%82%8B%20main_clk%20%E3%81%A7%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81CPU%20%E3%81%B8%E3%81%AE%E5%AE%9F%E9%9A%9B%E3%81%AE%E3%82%AF%E3%83%AD%E3%83%83%E3%82%AF%E3%81%A7%E3%81%82%E3%82%8B%20kCLOCK_BusClk%20%E3%81%AB%E5%AF%BE%E3%81%97%E3%81%A6%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8B%E3%81%A8%E6%80%9D%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E6%95%AC%E5%85%B7%3C%2FP%3E%3CP%3E%E3%83%95%E3%82%A9%E3%83%AB%E3%82%B1%E3%83%AB%E3%83%88%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%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%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%E3%81%AF%E3%81%84%E3%80%81%E3%81%9D%E3%81%AE%E9%80%9A%E3%82%8A%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3EkCLOCK_DivAhbClk%E3%82%922%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Efsl_iap%20%E9%96%A2%E6%95%B0%E3%81%AF%20kCLOCK_BusClk%20%E3%82%92%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%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%E3%83%8F%E3%83%AA%E3%83%BC%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%E8%A6%AA%E6%84%9B%E3%81%AA%E3%82%8B%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%E3%81%94%E5%9B%9E%E7%AD%94%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%82%AF%E3%83%AD%E3%83%83%E3%82%AF%E3%82%92%20PLL0%20%E3%81%AB%E3%82%B3%E3%83%8D%E3%82%AF%E3%83%86%E3%83%83%E3%83%89%E3%81%97%E3%81%9F%20LPC55S69%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%20150%20MHz%20%E3%81%A7%E5%8B%95%E4%BD%9C%E3%81%97%E3%80%81%E9%80%9A%E5%B8%B8%E3%81%AF%3CSPAN%3EkCLOCK_DivAhbClk%20%E3%82%92%3C%2FSPAN%3E1%20%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%83%95%E3%83%A9%E3%83%83%E3%82%B7%E3%83%A5%E3%81%AB%E6%9B%B8%E3%81%8D%E8%BE%BC%E3%82%80%E3%81%A8%E3%81%8D%E3%81%AF%E3%80%81CPU%20%E3%82%92%2075MHz%20%E3%81%A7%E5%8B%95%E4%BD%9C%E3%81%95%E3%81%9B%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AB%3CSPAN%3EkCLOCK_DivAhbClk%20%E3%82%92%3C%2FSPAN%3E2%20%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%A7%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E3%81%93%E3%81%AECASE%E3%80%81fsl_iap%20%E9%96%A2%E6%95%B0%E3%81%AF%20kCLOCK_BusClk%20%E3%82%92%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81kCLOCK_CoreSysClk%20%E3%81%A8%E7%95%B0%E3%81%AA%E3%82%8B%E3%81%9F%E3%82%81%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E6%95%AC%E5%85%B7%3C%2FP%3E%3CP%3E%E3%83%95%E3%82%A9%E3%83%AB%E3%82%B1%E3%83%AB%E3%83%88%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%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%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%E3%81%93%E3%81%AE%E3%83%87%E3%83%A2%E3%82%92%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%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%E7%A7%81%E3%81%AF%E7%99%BA%E8%A6%8B%E3%81%97%E3%81%9F%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%3ESO%E3%80%81kCLOCK_BusClk%20%E3%81%AF%20kCLOCK_CoreSysClk%20%E3%81%A8%E5%90%8C%E3%81%98%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3E%E3%81%9D%E3%81%97%E3%81%A6%E3%81%9D%E3%82%8C%E3%82%92%E5%8D%B0%E5%88%B7%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%9D%E3%82%8C%E3%82%89%E3%81%AF%E5%90%8C%E3%81%98%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3ECAN%E3%83%86%E3%82%B9%E3%83%88%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3E%E3%83%8F%E3%83%AA%E3%83%BC%3C%2FP%3E%3C%2FLINGO-BODY%3E