BootLoader on LPC1769

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

BootLoader on LPC1769

3,055件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Mon Nov 05 17:09:34 MST 2012
Hi,I need to use bootloader in one of my aplication, I thinking to use the bootloader example for RDB1768 examples to do this, but I don't want to compile my full code every time I need to change the firmware, so, Is possible to put my predefined functions on bootloader and call them by the user_code?like:
user_code {function1(sssss);function2(xxxx);} 
this way I will flash only a pice of code to the MCU, and my functions will be in bootloader.I will have problem with function address?Thanks in Advance;HCanova
0 件の賞賛
返信
12 返答(返信)

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Fri Nov 09 10:10:25 MST 2012

Quote: hcanova
can you explane I little bit more about BSP, I'm realy interested



BSP is short for Board Support Package.
This is what a lot of companies provide with their boards such that you don't have to write your own routines to access the serial port, network, or other peripherals that are on board.

This BSP can be very small, like CMSIS in the LPCXpresso environment. But it can also be extremely large with complete mass storage device drivers, network protocol stacks and special hard/software that make the board unique.
It can be any size of format that you provide.

For the BSP I would not create a split flash image, I prefer to use a library that you can link with the project as a binary library. This makes it easy to provide a new library once you discover a bug but it also allows the customer full control over the target.
Also, if the customer somehow clears the entire flash he/she still has the BSP available.

Rob
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ToBeFrank on Thu Nov 08 20:43:18 MST 2012

Quote: Rob65
I would skip your first question, I do not see a real use for this



If you have a custom bootloader, it's useful for saving flash space while still keeping a good separation between bootloader and application (separate projects).
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Thu Nov 08 11:59:34 MST 2012

Quote: Rob65
Are you still trying to program only part of your flash?
I was wondering because you had two questions: the first one asking how to use a kind of fixed library in flash that is called from your app and the second one asking how to use the USB bootloader.

I would skip your first question, I do not see a real use for this - except when you are providing customers with a custom board with a board support package that is pre-flashed. Even in that case I would suggest to provide a (binary) library with the BSP if you do not want to share the source code.

Using the USB bootloader is straight forward. Please be aware that you do need the USB bootloader project (provided on the NXP website) since there is no USB bootloader in the ROM of the lpc1769 - that is only true for the lpc1343 module.

You can of course create one projct with the USB bootloader and your (fixed) code but then again why?
The USB bootloader provides a complete project for the bootloader plus an example on how to create your own executable. Do read the manual and pay attention to the part where you have to change the linker map file that is created by the LPCXpresso IDE: the start address of your flash has to be changed because the usb bootloader uses the first blocks in flash.
It's all written down somewhere, just follow the instructions literally.

The 1.5k resistor mentioned is switched on/off by a transistor connected to P2.9. This is done to be able to switch the USB device off without having to disconnect the cable. In this way you can indeed re-enumerate te device (on a reset) or re-enumerate during operation with a different type of device.
I.e: the bootloader will switch the USB on and enumerate as a mass storage device for downloading. When the download is complete you could switch it off, start your application and create your own USB device.

Note: the only reason I see for splitting your application in a fixed library and a separate application is to speed up downloading when using the serial port downloader. But when using USB download that's not a problem anymore.

Rob




Hi Rob

Thank's for you answer

For my first question and the main question is exactly what you think, I don't want to share my code and I want to have an pre-flashed device,  can you explane I little bit more about BSP, I'm realy interested.

For the bootloader, I read the manual but maybe I made something wrong I will read again


Thanks again

Hcanova
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Thu Nov 08 08:16:22 MST 2012
Are you still trying to program only part of your flash?
I was wondering because you had two questions: the first one asking how to use a kind of fixed library in flash that is called from your app and the second one asking how to use the USB bootloader.

I would skip your first question, I do not see a real use for this - except when you are providing customers with a custom board with a board support package that is pre-flashed. Even in that case I would suggest to provide a (binary) library with the BSP if you do not want to share the source code.

Using the USB bootloader is straight forward. Please be aware that you do need the USB bootloader project (provided on the NXP website) since there is no USB bootloader in the ROM of the lpc1769 - that is only true for the lpc1343 module.

You can of course create one projct with the USB bootloader and your (fixed) code but then again why?
The USB bootloader provides a complete project for the bootloader plus an example on how to create your own executable. Do read the manual and pay attention to the part where you have to change the linker map file that is created by the LPCXpresso IDE: the start address of your flash has to be changed because the usb bootloader uses the first blocks in flash.
It's all written down somewhere, just follow the instructions literally.

The 1.5k resistor mentioned is switched on/off by a transistor connected to P2.9. This is done to be able to switch the USB device off without having to disconnect the cable. In this way you can indeed re-enumerate te device (on a reset) or re-enumerate during operation with a different type of device.
I.e: the bootloader will switch the USB on and enumerate as a mass storage device for downloading. When the download is complete you could switch it off, start your application and create your own USB device.

Note: the only reason I see for splitting your application in a fixed library and a separate application is to speed up downloading when using the serial port downloader. But when using USB download that's not a problem anymore.

Rob
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Thu Nov 08 06:09:00 MST 2012

Quote: Serge
Have you double checked on the schematics?

For example the LPCxpresso 1769 board uses P2[9] to activate the pull-up resistor. This is used to make te pc re-emunerate the usb connection in case of a software reboot for example.



Hi

I saw one 1k5 resitor, I will verify if this is active or not

thanks

Hcanova
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Wed Nov 07 17:07:16 MST 2012
Have you double checked on the schematics?

For example the LPCxpresso 1769 board uses P2[9] to activate the pull-up resistor. This is used to make te pc re-emunerate the usb connection in case of a software reboot for example.
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Wed Nov 07 08:27:11 MST 2012

Quote: Serge
What about the pullup resistor on D+? How did you make the connection in hardware?



Hi

I'm using on Embedded Artists board, I guess is everything OK with the hardware

hcanova
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Wed Nov 07 00:35:29 MST 2012
What about the pullup resistor on D+? How did you make the connection in hardware?
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Tue Nov 06 17:36:53 MST 2012

Quote: hcanova
Thanks ToBeFrank for your answer

I'will try this but now I have problem with the usb_bootloader, I will try to fix ant test your code

thanks

HCanova



Hi

I tried to use the usb_bootloader but don't work! I compiled with the lpcxpresso and the code stops on

while (1) {
USBHwISR();
}


I put and remove the usb cable many times an nothing happen, I'm using the USB interface on pins P0.30 and P0.29 is it ok?

thanks
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Tue Nov 06 15:13:08 MST 2012
Thanks ToBeFrank for your answer

I'will try this but now I have problem with the usb_bootloader, I will try to fix ant test your code

thanks

HCanova
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ToBeFrank on Tue Nov 06 14:46:19 MST 2012
Set up a project for your bootloader and a project for your application. In the bootloader project, have a header file (let's call it app_api.h) like this:

#define API_ADDRESS 0x1000
typedef struct
{
  void (*SomeFunc1) (int foo);
  bool (*SomeFunc2) (int bar);
  ...
} app_api_t;

#define g_appApi_ ((app_api_t*)API_ADDRESS)
Then, also in the bootloader project, create the .c file and fill in the api struct and locate it at API_ADDRESS (note that this is keil syntax):

const app_api_t appApi_ __attribute__((used,at(API_ADDRESS))) =
{
  SomeFunc1,
  SomeFunc2,
  ...
};
Then, in your application project include app_api.h from your bootloader project. You can then call bootloader functions like this:

g_appApi_->SomeFunc1(foo);
Note that you need to be careful about sharing RAM between the bootloader and the application.
0 件の賞賛
返信

2,691件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hcanova on Tue Nov 06 14:36:57 MST 2012
Hello,

I tried to use the usb_bootloader on lpcxpresso but without success, some one had experience with this?

For my problem (use in user code the functions of bootloader) I thinking to make a table with the address of the functions in bootloader to call in the user code. It's possible?

thanks in advance


HCanova
0 件の賞賛
返信