2 posts / 0 new
Last post
Wouter
Offline
Last seen:6 years 4 months ago
Expert
加入:2014-01-29 19:56
SDK examples

I have tested the peripheral example and the proximity example and both of them are up and running after some struggels.

的peripheral example contains the main function so the main() in ROM code is not called. The proximity example uses the main_func so the main() in ROM is called. How does this work? I see different SystemInit functions but I explain the startup behavior of both examples.

Proximity Init
void SystemInit (void)
{
SystemCoreClock = __SYSTEM_CLOCK;
SetBits32(GP_CONTROL_REG, EM_MAP, 23);
memset((void*)0x80000,0,0x3000);

__enable_irq();
}

Peripheral example init
void SystemInit (void)
{
SystemCoreClock = XTAL;

return;
}

For both I am using the sysram.ini only in the proximity the global interrupts are enabled. But the peripheral example uses alse interrupts so there it must be enabled to?

Could you explain what I am missing? Thanks in advance!

AK_Dialog
Offline
Last seen:1 week 3 days ago
Staff
加入:2013-12-16 15:49
SDK examples

Hi Wouter,
In the peripheral example the interrupts are enabled in the individual cases:
See for example timer.c line 30:
NVIC_EnableIRQ(SWTIM_IRQn); // enable interrupt

Hope this explains.

Regards,
Dialog Support Team

Topic locked