增加强制boot引脚
This commit is contained in:
parent
8e8b20623e
commit
3d81a0d86a
@ -207,7 +207,7 @@ var FuncSendPackage = function(){
|
|||||||
data[i+1] = table.remove(Packdata);
|
data[i+1] = table.remove(Packdata);
|
||||||
}
|
}
|
||||||
CANHw.SendMsg(PackID,data);
|
CANHw.SendMsg(PackID,data);
|
||||||
//sleep(1);
|
sleep(0.1);
|
||||||
PackNext += 1;
|
PackNext += 1;
|
||||||
if(PackNext > 0x2f){
|
if(PackNext > 0x2f){
|
||||||
PackNext = 0x20;
|
PackNext = 0x20;
|
||||||
|
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
/* Value of the external crystal or oscillator clock frequency in Hz */
|
/* Value of the external crystal or oscillator clock frequency in Hz */
|
||||||
#define CPU_XTAL_CLK_HZ (16000000u)
|
#define CPU_XTAL_CLK_HZ (8000000u)
|
||||||
#if CPU_XTAL_CLK_HZ > 40000000
|
#if CPU_XTAL_CLK_HZ > 40000000
|
||||||
#error "The external crystal or oscillator clock frequency is out of range."
|
#error "The external crystal or oscillator clock frequency is out of range."
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
<MemConfigValue>e:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0144.ddf</MemConfigValue>
|
<MemConfigValue>e:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0144.ddf</MemConfigValue>
|
||||||
</PlDriver>
|
</PlDriver>
|
||||||
<ArmDriver>
|
<ArmDriver>
|
||||||
<EnforceMemoryConfiguration>1</EnforceMemoryConfiguration>
|
|
||||||
<EnableCache>0</EnableCache>
|
<EnableCache>0</EnableCache>
|
||||||
|
<EnforceMemoryConfiguration>1</EnforceMemoryConfiguration>
|
||||||
</ArmDriver>
|
</ArmDriver>
|
||||||
<DebugChecksum>
|
<DebugChecksum>
|
||||||
<Checksum>3190234441</Checksum>
|
<Checksum>3190234441</Checksum>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -64,11 +64,12 @@ static void hw_clock_init(McuType *obj)
|
|||||||
|
|
||||||
|
|
||||||
/* Setup the FIRC2 div2 clock */
|
/* Setup the FIRC2 div2 clock */
|
||||||
|
|
||||||
clockConfig.gating = true;
|
clockConfig.gating = true;
|
||||||
clockConfig.source = CLOCKDRV_FIRC;
|
clockConfig.source = CLOCKDRV_SOSC;
|
||||||
clockConfig.div = 1;
|
clockConfig.div = 1;
|
||||||
ClockDrv_ConfigureClock(&obj->clockDrv, CLOCKDRV_FIRC_DIV2, &clockConfig);
|
ClockDrv_ConfigureClock(&obj->clockDrv, CLOCKDRV_SOSC_DIV2, &clockConfig);
|
||||||
|
|
||||||
/* Setup the SPI clock */
|
/* Setup the SPI clock */
|
||||||
clockConfig.gating = true;
|
clockConfig.gating = true;
|
||||||
clockConfig.source = CLOCKDRV_PLL_DIV2;
|
clockConfig.source = CLOCKDRV_PLL_DIV2;
|
||||||
|
@ -50,7 +50,7 @@ void SystemInit(void)
|
|||||||
|
|
||||||
#if defined (_USE_EXT_OSC_)
|
#if defined (_USE_EXT_OSC_)
|
||||||
/* Use External oscillator */
|
/* Use External oscillator */
|
||||||
AcgReg_SetOscRange(ACG, 3); /* set SOSC frequency range(use max value when SOSC as the clock source of the PLL) */
|
AcgReg_SetOscRange(ACG, 2); /* set SOSC frequency range(use max value when SOSC as the clock source of the PLL) */
|
||||||
AcgReg_SetEnSosc(ACG, 1); /* enable SOSC */
|
AcgReg_SetEnSosc(ACG, 1); /* enable SOSC */
|
||||||
while(AcgReg_GetStSoscRdy(ACG) == 0); /* wait until SOSC is ready */
|
while(AcgReg_GetStSoscRdy(ACG) == 0); /* wait until SOSC is ready */
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ void SystemInit(void)
|
|||||||
*/
|
*/
|
||||||
AcgReg_SetPllClkIn(ACG, 2);
|
AcgReg_SetPllClkIn(ACG, 2);
|
||||||
AcgReg_SetPllPreDiv(ACG, 0);
|
AcgReg_SetPllPreDiv(ACG, 0);
|
||||||
AcgReg_SetPllM(ACG, 45);
|
AcgReg_SetPllM(ACG, 90);
|
||||||
AcgReg_SetPllFbkSel(ACG, 0);
|
AcgReg_SetPllFbkSel(ACG, 0);
|
||||||
AcgReg_SetPllPosDiv(ACG, 3);
|
AcgReg_SetPllPosDiv(ACG, 3);
|
||||||
/* SCG PLL configuration:
|
/* SCG PLL configuration:
|
||||||
|
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
/* Value of the external crystal or oscillator clock frequency in Hz */
|
/* Value of the external crystal or oscillator clock frequency in Hz */
|
||||||
#define CPU_XTAL_CLK_HZ (16000000u)
|
#define CPU_XTAL_CLK_HZ (8000000u)
|
||||||
#if CPU_XTAL_CLK_HZ > 40000000
|
#if CPU_XTAL_CLK_HZ > 40000000
|
||||||
#error "The external crystal or oscillator clock frequency is out of range."
|
#error "The external crystal or oscillator clock frequency is out of range."
|
||||||
#endif
|
#endif
|
||||||
|
@ -228,6 +228,7 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>CCDefines</name>
|
<name>CCDefines</name>
|
||||||
<state>MCU_CVM0144FMLH</state>
|
<state>MCU_CVM0144FMLH</state>
|
||||||
|
<state>_USE_EXT_OSC_</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCPreprocFile</name>
|
<name>CCPreprocFile</name>
|
||||||
@ -694,7 +695,7 @@
|
|||||||
<data>
|
<data>
|
||||||
<extensions></extensions>
|
<extensions></extensions>
|
||||||
<cmdline></cmdline>
|
<cmdline></cmdline>
|
||||||
<hasPrio>0</hasPrio>
|
<hasPrio>1</hasPrio>
|
||||||
<buildSequence>inputOutputBased</buildSequence>
|
<buildSequence>inputOutputBased</buildSequence>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
|
@ -80,8 +80,8 @@
|
|||||||
<MemConfigValue>e:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0144.ddf</MemConfigValue>
|
<MemConfigValue>e:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0144.ddf</MemConfigValue>
|
||||||
</PlDriver>
|
</PlDriver>
|
||||||
<ArmDriver>
|
<ArmDriver>
|
||||||
<EnableCache>0</EnableCache>
|
|
||||||
<EnforceMemoryConfiguration>1</EnforceMemoryConfiguration>
|
<EnforceMemoryConfiguration>1</EnforceMemoryConfiguration>
|
||||||
|
<EnableCache>0</EnableCache>
|
||||||
</ArmDriver>
|
</ArmDriver>
|
||||||
<TerminalIO>
|
<TerminalIO>
|
||||||
<InputSource>1</InputSource>
|
<InputSource>1</InputSource>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -810,6 +810,13 @@ int main(void)
|
|||||||
PinsDrv_SetPullSel(&mcu.ptb, 5, PINSDRV_INTERNAL_PULL_UP);
|
PinsDrv_SetPullSel(&mcu.ptb, 5, PINSDRV_INTERNAL_PULL_UP);
|
||||||
PinsDrv_WritePin(&mcu.ptb, 5, 0);
|
PinsDrv_WritePin(&mcu.ptb, 5, 0);
|
||||||
|
|
||||||
|
//SIT1021 SLP
|
||||||
|
PinsDrv_SetMuxModeSel(&mcu.ptd, 7, PINSDRV_MUX_AS_GPIO);
|
||||||
|
PinsDrv_SetPinDirection(&mcu.ptd, 7, 1);
|
||||||
|
PinsDrv_WritePin(&mcu.ptd, 7, 1);
|
||||||
|
PinsDrv_SetMuxModeSel(&mcu.ptc, 2, PINSDRV_MUX_AS_GPIO);
|
||||||
|
PinsDrv_SetPinDirection(&mcu.ptc, 2, 0);
|
||||||
|
|
||||||
/* UDS init */
|
/* UDS init */
|
||||||
Uds_UserInit(&udsObj, &udsParam);
|
Uds_UserInit(&udsObj, &udsParam);
|
||||||
|
|
||||||
@ -823,8 +830,8 @@ int main(void)
|
|||||||
|
|
||||||
IrqDrv_EnableGlobalInterrupt();
|
IrqDrv_EnableGlobalInterrupt();
|
||||||
|
|
||||||
|
SEGGER_RTT_printf(0,"gCpuClockFrequency = %d\n",gCpuClockFrequency);
|
||||||
|
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
if(gSystick1msEvent > 0u)
|
if(gSystick1msEvent > 0u)
|
||||||
@ -835,7 +842,10 @@ int main(void)
|
|||||||
{
|
{
|
||||||
SBC_WD_Trigger();
|
SBC_WD_Trigger();
|
||||||
}
|
}
|
||||||
|
if (PinsDrv_ReadPin(&mcu.ptc, 2) == 0)
|
||||||
|
{
|
||||||
|
Bootloader_EventEmergeBootRequest(true);
|
||||||
|
}
|
||||||
if (gSystick1msCnt % 500 == 0)
|
if (gSystick1msCnt % 500 == 0)
|
||||||
{
|
{
|
||||||
ret = SBC_Read_Command(SBC_WD_CTRL);
|
ret = SBC_Read_Command(SBC_WD_CTRL);
|
||||||
@ -863,7 +873,8 @@ int main(void)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Bootloader_TimingProcess(1);
|
Bootloader_TimingProcess(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user