Page 2 of 2

Re: CORTEX_VTOR_INIT

Posted: Sun Jun 19, 2016 6:10 pm
by Giovanni
Hi,

16.1.x is stable and the next small release, trunk is development code but quite stable.

Giovanni

Re: CORTEX_VTOR_INIT

Posted: Sun Jun 19, 2016 9:42 pm
by Al B
Hi,

Thanks.
So other than the OS test suite (chibios/test), is there any testing done on the rest of the HAL or demos, or do we need to build/run our own?

In terms of the merge (r9643 r9645), looked over those and they look good.

In terms of moving IAR project from branch to trunk, bigger pain than I was expecting.
Still researching ways to reduce the effort and error proneness of this, so could be a bit.
I thought IAR had relative paths for files that are part of a specific project (so that base files used like \os\* could switch from say 16.1 to trunk by simply changing an IAR path (argument) variable).
But unfortunately, so far have only been able to figure out how to do this for include paths (which helps), but not the actual .c files (so far).

If anyone reading this knows how to do this, or something similar/or better ways, please let us know.

Thanks,
Al

Re: CORTEX_VTOR_INIT

Posted: Sun Jun 19, 2016 10:01 pm
by Giovanni
Hi,

Maintaining lots of projects using proprietary monolithic XML files is very hard, this is why there are so few of them. Makefiles, especially if well segmented, are so much more convenient.

I often modify XML projects by search/replace, if it is just paths this is often sufficient.

Giovanni

Re: CORTEX_VTOR_INIT

Posted: Mon Jul 01, 2019 3:17 pm
by rubenswerk
Hello,

I successfully used CORTEX_VTOR_INIT macro in old ChibiOS version to relocate vector table in a bootloader/application project (STM32F4).
Now I want to upgrade to actual ChibiOS.
According to this thread, it should be enough to set flash location in linker script:

flash0 : org = 0x08008000, len = 128k - 32k

When I look into hex file, vector table points to code located at the correct addresses.
In the .lst file, I see assembly instructions which set VTOR register to the correct value.

However, my application does not work. No matter if there is my old bootloader at 0x0800000, or the flash is empty, my applications fails to run.
By the way, if flash is filled with 0xff, will the program counter increase until it reaches 0x08008000 and then execute the application?

I ST-Link command line interface to run from 0x00008000 when there is no bootloader, but I never succeed.

What do I miss, what else has to be considered when moving the vector table?
I read threads which suggest to clear resets and control register, but at least when I run directly from 0x08008000 after a reset (via ST Link), this should have no impact!?

Unfortunately, I have no working debugger setup here...

Any recommendations?

Thanks,
rubenswerk

Re: CORTEX_VTOR_INIT

Posted: Mon Jul 01, 2019 4:36 pm
by Giovanni
Hi,

Now the VTOR register is initialized in the startup file, no need to do that anymore.

Code: Select all

#if CRT0_VTOR_INIT == TRUE
                ldr     r0, =_vectors
                movw    r1, #SCB_VTOR & 0xFFFF
                movt    r1, #SCB_VTOR >> 16
                str     r0, [r1]
#endif


Probably your problem is not related to this.

By the way, if flash is filled with 0xff, will the program counter increase until it reaches 0x08008000 and then execute the application?


Not sure, it depends on the opcode and assuming it is a valid instruction, else you hit an exception.

Giovanni

Re: CORTEX_VTOR_INIT

Posted: Sat Jul 06, 2019 8:38 pm
by rubenswerk
This post solved my problem:

http://www.chibios.com/forum/viewtopic.php?t=4767#p33503

After resetting the SysTick, it works!