Not applicable
Jul 07, 2016
03:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2016
03:21 AM
Hi,
I have developed the custom boot loader on the XMC 1404 with 200 KB flash size.
my boot loader occupies the range address on flash 0x10001000 to 0x10005000
the application occupies the range address on flash 0x10005001 to 0x10033000
the function for jump to application is:
Reboot_Loader PROC
EXPORT Reboot_Loader
LDR R0, =0x10005001
BX R0
ENDP
but this function generate the hard fault error.
any idea?
thanks
U.I.
I have developed the custom boot loader on the XMC 1404 with 200 KB flash size.
my boot loader occupies the range address on flash 0x10001000 to 0x10005000
the application occupies the range address on flash 0x10005001 to 0x10033000
the function for jump to application is:
Reboot_Loader PROC
EXPORT Reboot_Loader
LDR R0, =0x10005001
BX R0
ENDP
but this function generate the hard fault error.
any idea?
thanks
U.I.
- Tags:
- IFX
11 Replies
Jul 07, 2016
08:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2016
08:45 PM
Hello,
I found an article from the following link:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka12545.html
In this case, the application should occupy the address range starting from 0x10005000 instead of 0x10005001.
The call to function remains to 0x10005001.
This way, the processor will branch to address 0x10005000 but interpret the instruction found there as a Thumb opcode, due to LSB=1.
Regards,
Min Wei
I found an article from the following link:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka12545.html
In this case, the application should occupy the address range starting from 0x10005000 instead of 0x10005001.
The call to function remains to 0x10005001.
This way, the processor will branch to address 0x10005000 but interpret the instruction found there as a Thumb opcode, due to LSB=1.
Regards,
Min Wei
Not applicable
Jul 07, 2016
11:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2016
11:36 PM
Hi Min,
I have set start address 0x10005000 but not work, this generate fault hardware.
in the application, the vector table must be set?
Thanks
U.I.
I have set start address 0x10005000 but not work, this generate fault hardware.
in the application, the vector table must be set?
Thanks
U.I.
Attachments are accessible only for community members.
Jul 08, 2016
02:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 08, 2016
02:09 AM
Hello U. I.,
The vector table is dependent on the application and should not be a problem.
I have built a simple example to model your use case, please see attached zipped file.
The example consists of 2 projects:
1) a "bootloader" project which
- is defined for the Flash range 0x10001000 - 0x10005000 by modifying the linker script file
- contains just the code:
2) a running LEDs example that
- is defined for the Flash range 0x10005000 - 0x10005001 similarly by modifying the linker script file
- toggles in sequence P4.0, P4.1, P4.2 and P4.3 based on the SysTick interrupt handler
Since there isn't a real bootloader, I downloaded the two hex codes into the XMC1400 device using XMC Flasher tool.
The "bootloader" codes will trigger the branch to 0x10005000 which contains the reset vector of the application program.
The vector table of the application will be set up accordingly and system initializes (system startup).
Finally the running LEDs code executes (application is running).
Is your solution built similarly to the above flow?
If so, could there still be issues with the actual bootloader codes?
Regards,
Min Wei
The vector table is dependent on the application and should not be a problem.
I have built a simple example to model your use case, please see attached zipped file.
The example consists of 2 projects:
1) a "bootloader" project which
- is defined for the Flash range 0x10001000 - 0x10005000 by modifying the linker script file
- contains just the code:
__asm
(
"LDR r0, =0x10005001\n"
"BLX r0"
);
2) a running LEDs example that
- is defined for the Flash range 0x10005000 - 0x10005001 similarly by modifying the linker script file
- toggles in sequence P4.0, P4.1, P4.2 and P4.3 based on the SysTick interrupt handler
Since there isn't a real bootloader, I downloaded the two hex codes into the XMC1400 device using XMC Flasher tool.
The "bootloader" codes will trigger the branch to 0x10005000 which contains the reset vector of the application program.
The vector table of the application will be set up accordingly and system initializes (system startup).
Finally the running LEDs code executes (application is running).
Is your solution built similarly to the above flow?
If so, could there still be issues with the actual bootloader codes?
Regards,
Min Wei
Not applicable
Jul 11, 2016
02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 11, 2016
02:21 AM
Hi,
I am using the uVision Keil or DAVE tools, you can program on the demo board?
Regards,
U.I.
I am using the uVision Keil or DAVE tools, you can program on the demo board?
Regards,
U.I.
Not applicable
Jul 13, 2016
12:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 13, 2016
12:06 AM
Hi,
I loaded with J-Flash Lite your boot and application hex file successfully.
If I load flash my hex files and your boot hex files, do not work.
The my hex file is created (with uVision tools) at start address 0x10005000.
any idea?
Thanks
I loaded with J-Flash Lite your boot and application hex file successfully.
If I load flash my hex files and your boot hex files, do not work.
The my hex file is created (with uVision tools) at start address 0x10005000.
any idea?
Thanks
Jul 13, 2016
11:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 13, 2016
11:10 PM
Hello,
I tried generating a LED blinking hex file with uVision5 and this works for me (application program can be entered).
For keil, you can directly modify the address from the project properties:
Can you try creating a simple application to see if it works?
Just to be sure the problem is not due to the current application program.
Regards,
Min Wei
I tried generating a LED blinking hex file with uVision5 and this works for me (application program can be entered).
For keil, you can directly modify the address from the project properties:
Can you try creating a simple application to see if it works?
Just to be sure the problem is not due to the current application program.
Regards,
Min Wei
Attachments are accessible only for community members.
Not applicable
Jul 14, 2016
12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2016
12:01 AM
Jul 14, 2016
02:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2016
02:26 AM
Hello,
There is an error when I tried to open the file with WinZip.
It says that the file is not a valid archive file.
Do you think you can attached the zipped file again?
Hopefully it is just a one-time issue.
Regards,
Min Wei
There is an error when I tried to open the file with WinZip.
It says that the file is not a valid archive file.
Do you think you can attached the zipped file again?
Hopefully it is just a one-time issue.
Regards,
Min Wei
Attachments are accessible only for community members.
Not applicable
Jul 14, 2016
03:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2016
03:18 AM
Jul 14, 2016
08:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2016
08:10 PM
Hello,
I have tried your code.
Yes, I am also not able to get the DAVE-generated bootloader and Keil-generated application to work.
However, if I use a Keil-generated bootloader to go with your code, it works fine.
So my suspicion is that the previous problem is related to the different compilers used.
Can you try to create the bootloader program using Keil instead?
I am using the following code with Flash start address at 0x10001000 and size 0x4000
Regards,
Min Wei
I have tried your code.
Yes, I am also not able to get the DAVE-generated bootloader and Keil-generated application to work.
However, if I use a Keil-generated bootloader to go with your code, it works fine.
So my suspicion is that the previous problem is related to the different compilers used.
Can you try to create the bootloader program using Keil instead?
I am using the following code with Flash start address at 0x10001000 and size 0x4000
void RunAPP(void);
int main(void)
{
RunAPP();
while(1)
{
/* Infinite loop */
}
}
// run the codes from application flash areas
__asm void RunAPP(void)
{
LDR r0, =0x10005001
BLX r0
}
Regards,
Min Wei
Not applicable
Jul 15, 2016
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 15, 2016
07:15 AM
Hello,
I resolved!!!
the problem was in the function for jumping to the application.
In uVision Keil Tools the function for jump to the application is:
JumpToUserApplication
msr msp, r0
msr psp, r0
bx r1
END
is called in the main function:
#define RELOCATED_VECTORS 0x10005000 // Start address of relocated interrutp vector table
void JumpToUserApplication(LWord userSP, LWord userStartup);
/**
****************************************************************************
* Funzione di main
*
* \param nessuno
*
* \return nessuno
*
****************************************************************************
*/
int main ( void )
{
JumpToUserApplication(*((unsigned long*)RELOCATED_VECTORS), *((unsigned long*)(RELOCATED_VECTORS+4)));
while(1)
{
}
}
U.I.
I resolved!!!
the problem was in the function for jumping to the application.
In uVision Keil Tools the function for jump to the application is:
JumpToUserApplication
msr msp, r0
msr psp, r0
bx r1
END
is called in the main function:
#define RELOCATED_VECTORS 0x10005000 // Start address of relocated interrutp vector table
void JumpToUserApplication(LWord userSP, LWord userStartup);
/**
****************************************************************************
* Funzione di main
*
* \param nessuno
*
* \return nessuno
*
****************************************************************************
*/
int main ( void )
{
JumpToUserApplication(*((unsigned long*)RELOCATED_VECTORS), *((unsigned long*)(RELOCATED_VECTORS+4)));
while(1)
{
}
}
U.I.