Hi everyone
We are using twrk60n512+MQX 3.6.2
Can anyone point the way to reset the board from MQX?
Thanx in advance
Solved! Go to Solution.
Hi,
Sorry, the complete code is this:
#define MCF5225_CCM_RCR_SOFTRST (1 << 7)void MCF52259_REBOOT(void){VMCF5225_STRUCT_PTR reg_ptr = (VMCF5225_STRUCT_PTR)BSP_IPSBAR; reg_ptr->CCM.RCR |= MCF5225_CCM_RCR_SOFTRST;}
icheifot, I meant to say "Maybe you can use a similar method that I use in MCF5225X"
I hope I'm not making a huge mistake by doing this, but it works.
__boot();
My starting task that calls all others first checks it's non-volatile ram for a correctly formatted firmware upgrade file and if it likes what it sees it upgrades a portion of my application then calls __boot();
So far so good.
Thank you very much for your help
Your solution works, and i have created the support request with Freescale to confirm that calling __boot() function will not lead to problems.
I will post here when i hear from them
Cheers
I think this is the correct way to do it:
Thank you for the reply Carl
However this code is for the m52259 board and im working with the K60n512
Ill try to find the similar way to do it on Kinetis platform
To answer this question, to do a soft reset on the Kinetis platform you need to set the SYSRESETREQ bit in the NVIC AIRCR register.
In the MK40X256VMD100 header file the register is SCB_AIRCR and you cannot just do a read modify write on this register because it has a vector key that must be written correctly and doesn't read the same. Here is a little snippet of code to reset the Kinetis:
uint_32 read_value = SCB_AIRCR; read_value &= ~SCB_AIRCR_VECTKEY_MASK; read_value |= SCB_AIRCR_VECTKEY(0x05FA); read_value |= SCB_AIRCR_SYSRESETREQ_MASK; _int_disable(); SCB_AIRCR = read_value; while(1);
This topic was included on a post from 4-Mach-20011 that implemented the Kinetis software reset capability inside a watchdog routine as well.
https://community.freescale.com/message/79984#79984
Briwal..thanks for your code as well.
Regards,
David
I'm using MQX 3.6 along with CW7.2 and a MCF52259. I tried Carl's solution and ended up with unknown MCF5225_CCM_RCR_SOFTRST.
Where is this defined?
Hi,
Sorry, the complete code is this:
#define MCF5225_CCM_RCR_SOFTRST (1 << 7)void MCF52259_REBOOT(void){VMCF5225_STRUCT_PTR reg_ptr = (VMCF5225_STRUCT_PTR)BSP_IPSBAR; reg_ptr->CCM.RCR |= MCF5225_CCM_RCR_SOFTRST;}
icheifot, I meant to say "Maybe you can use a similar method that I use in MCF5225X"
Thanks Carl, you have solved an ancient mystery.