cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

ALuo4
New Contributor

I am looking for a standalone package that has an executable bootloader host application without the need for PSoC Creator. This is similar to project AN73503 that creates a bootloader host for HIDs but instead I require a UART version.

I am aware of project AN68272 as well, which although is for UART’s, it only configures a UART bootloader without a separate host.

0 Likes
3 Replies
Alakananda_BG
Moderator
Moderator

Hi,

The App note AN68272 which you have mentioned is only available for the UART Bootloader, you need to use this and change the communication component to other peripheral.

Regards

Alakananda
0 Likes
ALuo4
New Contributor

Hi Alakananda,

Thanks for the reply. I have looked through note AN68272 and I am looking for a standalone PC bootloader host (without PSoC) that directly connects to the target. This is not solved by the ‘Bootloading Using a PC Host’ section (2.4) as this still requires the PSoC installation. Let me know if I am missing something, thank you

0 Likes
ARH
New Contributor II

If you look in the PSoC Creator/4.3/PSoC Creator/cybootloaderutils directory you will find the C source files that you need in order to create your own bootloader host.

 

In order to do this you need to be able to make and compile a c-program for your target host.

The library is easy to use.... basically you create and fill a structure of type 

CyBtldr_CommunicationsDat
 
The members of this structure are 
typedef struct
{
/* Function used to open the communications connection */
int (*OpenConnection)(void);
/* Function used to close the communications connection */
int (*CloseConnection)(void);
/* Function used to read data over the communications connection */
int (*ReadData)(unsigned char*, int);
/* Function used to write data over the communications connection */
int (*WriteData)(unsigned char*, int);
/* Value used to specify the maximum number of bytes that can be trasfered at a time */
unsigned int MaxTransferSize;
} CyBtldr_CommunicationsData;


 
So you need to provide function pointers to:
open the serial port
close the serial port
read data from the device
write data to the device
 
And a limit of the maximum transfer size.
 
I did an I2C implementation for the raspberry pi... here is some cuts of the code.
 
To use this you do something like this:
 
printf("Starting Setup\n");

//setup reset pin
if(!bcm2835_init())
{
printf("init failed\n");
exit(0);
}

bcm2835_gpio_fsel(P4RESET, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_clr(P4RESET);

cd.OpenConnection = &CYPIOpenConnection;

cd.CloseConnection = &CYPICloseConnection;
cd.ReadData = &CYPIReadData;
cd.WriteData = &CYPIWriteData;
// cd.MaxTransferSize = 100;
cd.MaxTransferSize = 20;

printf("Ending Setup\n");

return CYRET_SUCCESS;
 
CyBtldr_Action action = PROGRAM;
rval = CyBtldr_RunAction(action, "p4arduino-creek.cyacd", &cd , &PUpdate);
 
 
Alan