2014-06-30 01:32 AM
Hi,
On our board which contains stm32f105R8, I can see no usart1 activity. I'ved used the supplied ST printf example to configure usart1. Our board has an external 8MHz crystal and I've seen it mentioned that the CL series expects an external 25Mhz crystal by default, so that may be the issue. I have set the XTAL clock value to be 8MHz in uVision4 tools hoping that would solve our problem but no luck. Does anyone have the correct settings for stm32f10x.h in order to use the external 8 Mhz crystal to generate a system clock of 48 Mhz? Thank you Bob2014-07-10 12:38 AM
Hi Clive,
I'm using the startup_stm32f10x_cl.s as the bootloader. Nothing else. Could you elaborate a little more on the offset issue and what should I use as the base address? Regards Bon2014-07-10 08:02 AM
Hi Clive,
My understanding is that the Vector table contains the pointers to the various exception/interrupts handlers. Now I can see these addresses located at addresses from 0x00000000 upwards. Therefore I would expect that SCB->VTOR should contain 0x00000000 and not 0x08003000 in my application. Is my thinking correct? On reset the processor starts at 0x00000000 so what happens on reset if the vector table is relocated to say 0x08003000. How does the processor know to jump to this address? Where does it get this info from? Many Thanks Bob2014-07-10 08:58 AM
SCB->VTOR would be set by code in system_stm32f10x.c via SystemInit()
...
/*!<
Uncomment
the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
This value must be a multiple of 0x */
...
void SystemInit (void)
{
...
/* Configure the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers */
/* Configure the Flash Latency cycles and enable prefetch buffer */
SetSysClock();
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
#else
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
#endif
}
You'd also want to make sure you are building code to reside at 0x08000000, check the .MAP file, and any memory configuration / scatter file
...
Memory Map of the image
Image Entry point : 0x08000151
Load Region LR_IROM1 (Base: 0x08000000, Size: 0x0000052c, Max: 0x00040000, ABSOLUTE)
Execution Region ER_IROM1 (Base: 0x08000000, Size: 0x00000510, Max: 0x00040000, ABSOLUTE)
Base Addr Size Type Attr Idx E Section Name Object
0x08000000 0x00000150 Data RO 3406 RESET startup_stm32f10x_cl.o
0x08000150 0x00000000 Code RO 3411 * .ARM.Collect$$$$00000000 mc_w.l(entry.o)
0x08000150 0x00000004 Code RO 3678 .ARM.Collect$$$$00000001 mc_w.l(entry2.o)
0x08000154 0x00000004 Code RO 3681 .ARM.Collect$$$$00000004 mc_w.l(entry5.o)
0x08000158 0x00000000 Code RO 3683 .ARM.Collect$$$$00000008 mc_w.l(entry7b.o)
0x08000158 0x00000000 Code RO 3685 .ARM.Collect$$$$0000000A mc_w.l(entry8b.o)
0x08000158 0x00000008 Code RO 3686 .ARM.Collect$$$$0000000B mc_w.l(entry9a.o)
...
2014-07-10 03:56 PM
Hi Clive,
Up and running, the vector table offset was not set to zero. When this was set board lit up. Once again, many thanks for all your help..it is really appreciated...you're a star!!! I hope ST are paying you for your support. You are are huge bonus to them and I hope they recognise that. Best Regards Bob