Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

We use PSoC4L with USB and SPI components.

And now We are considering implementing Bootloader.

We read the application notes of SPIBootloader and USB HID Bootloader, and understand the operation of each.

Therefore, we are considering the following specifications,

For example,
When PSoC4L is powered on while pressing switch A, SPI Bootloader starts.
When PSoC4L is powered on while pressing switch B, USB HID Bootloader starts.

We thought that we could do this by switching the communication components of the Bootloader component,

but we don't know how to switch because that API does not exist.

Is it possible to use a Bootloader that switches multiple communication peripherals in the first place?

Do you have a reference project if possible?

Regard,

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

I didn't tried this but I have an idea.

You can use a custom interface for the bootloader.  So, it is able to create delegated function to access to multiple communication ports.

The bootloader requires five functions as follows.

  • CyBtldrCommStart
  • CyBtldrCommStop
  • CyBtldrCommReset
  • CyBtldrCommWrite
  • CyBtldrCommRead

For example, CyBtldrCommStart(void) function can be written as follows.

uint32      interface = 0;

void CyBtldrCommStart(void) {

    switch (interface) {

        case 0:

            SPI_1_CyBtldrCommStart();

            break;

        case 1:

            USBFS_1_CyBtldrCommStart();

            break;

        default:

            break;

    }

}

Please note that the variable interface indicates a communication port to be used.

Please refer the document "PSoC® Creator™ Component Author Guide" (Document # 001-42697) at the "10. Adding Bootloader Support (Advanced)" section.

Regards,

Noriaki

View solution in original post

0 Likes
3 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

I didn't tried this but I have an idea.

You can use a custom interface for the bootloader.  So, it is able to create delegated function to access to multiple communication ports.

The bootloader requires five functions as follows.

  • CyBtldrCommStart
  • CyBtldrCommStop
  • CyBtldrCommReset
  • CyBtldrCommWrite
  • CyBtldrCommRead

For example, CyBtldrCommStart(void) function can be written as follows.

uint32      interface = 0;

void CyBtldrCommStart(void) {

    switch (interface) {

        case 0:

            SPI_1_CyBtldrCommStart();

            break;

        case 1:

            USBFS_1_CyBtldrCommStart();

            break;

        default:

            break;

    }

}

Please note that the variable interface indicates a communication port to be used.

Please refer the document "PSoC® Creator™ Component Author Guide" (Document # 001-42697) at the "10. Adding Bootloader Support (Advanced)" section.

Regards,

Noriaki

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Noriaki-san,

Sorry for my late response.

We will try your suggestion.

Thanks,

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

We are considering the content you have proposed.

And we create a project to realize the operation.
If you have any problems creating a project, please provice us your advice again.


Thanks,

0 Likes