IAP_ReinvokeISP on the LPC804

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

IAP_ReinvokeISP on the LPC804

ソリューションへジャンプ
420件の閲覧回数
Oxolotol
Contributor III


I have the following code so I can restart the ISP and re-write flash after I have loaded valid application.

My code is 
uint32_t res_status; //
const uint32_t USART_ISP_1 = 1;
IAP_ReinvokeISP(USART_ISP_1, &res_status);

UM11064 
Command code: 57 (decimal)
Param0(mode): ISP interface selection
1 - USART ISP              <----- apparently this means that the constant 1 is the only valid parameter?

IAP_ReinvokeISP on my MCUXpresso the #define FSL_FEATURE_SYSCON_IAP_REINVOKE_ISP_PARAM_POINTER is not defined so the IAP_ISP_TYPE_XXX ##defines have no effect on the IDE supplied wrapper function (IAP_ReinvokeISP).

When I break point to one past this command I get the following error.
----
Break at address "0xdeadbeee" with no debug information available, or outside of program code.
----
What else does this command need?




ラベル(1)
タグ(2)
0 件の賞賛
1 解決策
385件の閲覧回数
Oxolotol
Contributor III

Tried to invalidate the  checksum at VTOR[7] based on the following statement from UM11065 with the following code:
uint32_t shadow_vector[16];
memcpy (shadow_vector, (uint8_t)0, 64 );
shadow_vector[7] = 0xffffffff;
IAP_PrepareSectorForWrite( 0 , 0); // prepare sector 0 for write
volatile status_t res2 =
// dst src num clk
IAP_CopyRamToFlash ( 0, shadow_vector, 64, SystemCoreClock );

but break pointing beyond this (and before the IAP_ReinvokeISP call).
the reading the memory tab at location 0 shows the values unchanged. (reasonable since they were not erased first.)
but previous attempts to erase the memory (64 bytes starting at address 0, with prep first) resulted in a FFFFFFF9 error.


元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
386件の閲覧回数
Oxolotol
Contributor III

Tried to invalidate the  checksum at VTOR[7] based on the following statement from UM11065 with the following code:
uint32_t shadow_vector[16];
memcpy (shadow_vector, (uint8_t)0, 64 );
shadow_vector[7] = 0xffffffff;
IAP_PrepareSectorForWrite( 0 , 0); // prepare sector 0 for write
volatile status_t res2 =
// dst src num clk
IAP_CopyRamToFlash ( 0, shadow_vector, 64, SystemCoreClock );

but break pointing beyond this (and before the IAP_ReinvokeISP call).
the reading the memory tab at location 0 shows the values unchanged. (reasonable since they were not erased first.)
but previous attempts to erase the memory (64 bytes starting at address 0, with prep first) resulted in a FFFFFFF9 error.


0 件の賞賛
398件の閲覧回数
Oxolotol
Contributor III

 

We can break point before the 

iap_entry(command, result);

call, but not after it (as expected). but
-- it does not respond to ISP commands
-- it does not respond  to IDE debugger pause button
-- it *does* respond to *application* USART0 commands as if it restarted the embedded code and did not stay in the ISP code


hhhmmm...

0 件の賞賛
398件の閲覧回数
Oxolotol
Contributor III

// set these to reset values per UM11065 4.6.8
SYSCON_MAINCLKSEL_SEL(0);
SYSCON_MAINCLKUEN_ENA(0);
SYSCON_SYSAHBCLKDIV_DIV(1);

I added these lines to match the reset values defined for the clock registers in UM11065 LPC804 User Manual.
This stopped the DEADBEEE, breakpoint, and breakpoints after the call don't occur (which is correct behavior)
but we are not able to get an ISP response on the USART0.  

The UM11065 Table 35 (4.6.8) only mentions USART ISP, but not which USART.  we are using USART0. 

0 件の賞賛
402件の閲覧回数
Oxolotol
Contributor III

I noticed that with my LPC804UK the "FSL_FEATURE_SYSCON_IAP_REINVOKE_ISP_PARAM_POINTER" is not enabled, so so all the IAP_ISP_TYPE_I2C style choices are not available for the ispType parameter.  Likely because they are not available for this chip.

0 件の賞賛