Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

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

cross mob
loop_y0u
Level 4
Level 4
25 replies posted 50 sign-ins 10 questions asked

Hi Community, I'm currently working on Cypress MCU for my bootloader implementation since I'm having a touch switch and using an ESP32 for Wi-Fi connectivity and accessibility. I've created a project in my PSOC Creator for my application and tested it with Bootloader Host which seems perfectly.

Right after this process I tried putting in some conditional statements where I'll be receiving some hex data for ex, 0xB4 etc. and whenever I receive this, ill be calling Bootloadable_Load(); and start flashing it via Bootloader Host.

Now I want to send the .cyacd file via UART to my CYP MCU and I'm trying hard to understand "Do I need to send acknowledgement for every packet received and or it will be sent by my API for Bootloader? Additionally I've heard that .cyacd is non standard form of HEX Binary, so what steps should I take to implement it properly.

0 Likes
1 Solution
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @loop_y0u ,

Looks like your question is answered in the below thread.
https://community.infineon.com/t5/PSoC-4/cyacd-file-format/td-p/696499

Let me know if you have any issues.

Thanks and regards,
Sidramesh

View solution in original post

0 Likes
6 Replies
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @loop_y0u ,

#Right after this process I tried putting in some conditional statements where I'll be receiving some hex data for ex, 0xB4 etc  and whenever I receive this, ill be calling Bootloadable_Load()
Can you please elaborate on this ?
In which project and where you will be putting conditional statement ?

Thanks and regards,
Sidramesh

0 Likes
lock attach
Attachments are accessible only for community members.
loop_y0u
Level 4
Level 4
25 replies posted 50 sign-ins 10 questions asked

Hi @Sidramesh_S ,

 

I've attached Screenshot where you can observe I'm checking for a condition in a while loop for the specific data to trigger/invoke the bootload API. In this case When I send "0xB4 0xF2 0x02 0x02 0x04" and it triggers the bootloadable_load(); and I've additionally put some LED indication in the Bootloader file so that if someone sends me the data explained above via TTL or USB to UART bridge then the indication of LED from bootloader file will tell me that my api got invoked and I can open the Bootloader Host now and choose the ".cyacd" file according to the changes made in my Application Source code's cyacd file and start programming. 

 

I don't know exactly how the data is transferred between the Bootloader host and my MCU. I mean what acknowledgement should i recieve for sending the next packet and how do i decode the cyacd file and send it byte by byte

0 Likes
loop_y0u
Level 4
Level 4
25 replies posted 50 sign-ins 10 questions asked

Hi Community, Can you help me getting rid of  this issue or can you make me understand the concept for Sending and Receiving .cyacd file via UART

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @loop_y0u ,

Please refer to the Host/Target Communications Section and Protocol Packet Format Section for understanding  the concept for Sending and Receiving .cyacd file via UART.
https://www.infineon.com/dgdl/Infineon-AN68272_PSoC_3_PSoC_4_PSoC_5LP_and_PSoC_Analog_Coprocessor_UA...

Thanks and regards,
Sidramesh

0 Likes
lock attach
Attachments are accessible only for community members.
loop_y0u
Level 4
Level 4
25 replies posted 50 sign-ins 10 questions asked

Hi @Sidramesh_S , 

Thank You For referring me the link. I have some question. 

I looked at the bootloader Datasheet and also found source code of the Bootloader Host at C:\\Program Files(x86)\\Cypress\\Psoc Creator\\4.4\\bootloadserutils. 
 
Q1 > It's parsing .cyacd file by first opening it and trying to find some "#" '\n' and '\r' . When I open .cyacd file it contains some hex values. I'll be attaching the Screenshot so that you can see the .cyacd file. I''ve heard that .cyacd file contains ASCII but when i look, it displays hex. So where does it looks for "#" '\n' and '\r' ? 
 
I'm trying to understand the Algorithm for making commands for my Application and parsing the .cyacd file into the buffer so that i can transmit it to my Touch Panel via UART of ESP32. Please help me out .
 
Function : 
 
// Function to read a line from the data file, ignoring comments
int CyBtldr_ReadLine(uint32_t* size, char* buffer)
{
    int err = CYRET_SUCCESS;  // Initialize error variable to success
    uint32_t len;             // Variable to store the length of the read line
    // Loop to continue reading lines until a non-comment line is encountered or an error occurs
    do
    {
        len = 0;  // Initialize the length variable to zero
        // Check if the dataFile is open and not at the end of the file
        if (NULL != dataFile && !feof(dataFile))
        {
            // Read a line from the dataFile into the buffer, with a maximum size of MAX_BUFFER_SIZE * 2
            if (NULL != fgets(buffer, MAX_BUFFER_SIZE * 2, dataFile))
            {
                // Calculate the length of the read line
                len = strlen(buffer);
                // Trim newline characters from the end of the line
                while (len > 0 && ('\n' == buffer[len - 1] || '\r' == buffer[len - 1]))
                    --len;
            }
            else
                err = CYRET_ERR_EOF;  // Set error to end-of-file if fgets fails
        }
        else
            err = CYRET_ERR_FILE;  // Set error to file error if dataFile is not open or at end-of-file
    } while (err == CYRET_SUCCESS && buffer[0] == '#');  // Continue loop if no error and line is a comment
    *size = len;  // Store the length of the read line in the provided size variable
    return err;   // Return the error status
}

 

 

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @loop_y0u ,

Looks like your question is answered in the below thread.
https://community.infineon.com/t5/PSoC-4/cyacd-file-format/td-p/696499

Let me know if you have any issues.

Thanks and regards,
Sidramesh

0 Likes