2014-04-03 09:16 AM
Dear,
i am proceeding over a development of a quiet simple application (23K of code now), increasing complexity, everything was working fine, but from some recent code improvements and builds, i started to have the application behavior corrupted. I am driving am SSD1289 lcd / touch, and driving also some gpio. Increasing the code size, LCD started to be non responsive to the graphic commands, so i commented out the great part of the code, and let only a small code working. If i just init the gpio, and make a relay click on and off each second, it works./**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
delay_decrement();
prescaler--;
if(prescaler == 0)
{
prescaler = 200;
}
}
void delay_decrement(void)
{
if (time_preload != 0x00) time_preload--;
}
void delay_ms(volatile uint32_t t)
{
time_preload = t;
while(time_preload != 0);
}
void run ()
{
for(;;)
{
gpio_relay_on_off(i);
i=!i;
delay_ms(1000);
}
}
But, if i start to enable the FSMC controller, with the line:
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
Then i hear the relay clicking on or off each 4 seconds.
Very strange. Could i have some hardware issue ?
Many thanks
Angelo
2014-04-03 09:36 AM
Could i have some hardware issue ?
Or a software one. Or one with your linker script.2014-04-03 09:58 AM
2014-04-03 10:44 AM
In the other thread I pointed to a project that uses GNU/GCC and has a functional linker script.
Linker Scripts (or Scatter Files, in Keil nomenclature) are complex beasts, I tend to find many examples and understand them, and adapt them as required. I have a background in linkers/loaders, and the GNU linker is far more inflexible than others that target embedded explicitly, ie split roms, or sparse memory maps. The complexity in ROM/FLASH based systems is that the start up code must initialize and copy things to RAM (unpack itself), rather than an executable file format, which paints each memory area explicitly.