Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Bootloader-Problem => "CyWriteRowData() doesn't work?!

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Bootloader-Problem => "CyWriteRowData() doesn't work?!
Moderator:
ANCY

Post Reply
Follow this topic



Bootloader-Problem => "CyWriteRowData() doesn't work?!

MasterJings posted on 10 Oct 2012 5:17 AM PST
Member
8 Forum Posts

Hello folks,

I'm trying to write a bootloader, using the builtin function of PSoC Creator 2.1 "CyWriteRowData()". Attached you will find an example.

My approach is to write to row-nr. 100, 256bytes of data (in this case 55 dec.) to the flash memory. Array ID should be 0.

Therefore Row 100, Array-ID 0 should be located @ 0x00006400.

CyWriteRowData() even writes data to this section, but it looks like, it is copying just the data, which is already is flash starting from 0x00000000?! (is used the MiniProg3 for debugging)

The Dev-Board I'm using is CY8CKIT-001 with the PSOC5 Header (121R-54600).

Is my approach totally wrong or do you got any suggestions?

I even looked at the code, which creates the component "Bootloader", but it didn't helped me out.

I'm grateful for any hints!

Bye, bye and thanks in advance...
 

Jings




Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

Bob Marlowe posted on 10 Oct 2012 06:33 AM PST
Top Contributor
1768 Forum Posts

Will you please post at least the complete call to CyWriteData() and tell us the retuned value.

 

Bob

 



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

MasterJings posted on 10 Oct 2012 07:49 AM PST
Member
8 Forum Posts

Thanks for your response.

I thought I had attached the example project, but the user form don't upload it. Another try ;)

 

Return-value is 0, which is ok....

Bye,

Jings



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

MasterJings posted on 10 Oct 2012 07:52 AM PST
Member
8 Forum Posts

Another try, probably it don't accepted the file because of the added dot's in the filename,

created by PSOC Creator....



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

MasterJings posted on 10 Oct 2012 07:56 AM PST
Member
8 Forum Posts

Don't know, why I can't upload the zip file, but nevertheless I'm posting just the plain test code:

void main()
{
    uint8 buffer[260];
    memset(buffer, 55, 256);
   
    uint8 array_id = 0;
    uint8 row = 100;
    cystatus status;
   
    CySetTemp();

    /* Write to flash => 0x6400 (Array=0, Row=100) */
    status = CyWriteRowData(array_id, row, buffer); 

    for(;;)
    {
        /* Place your application code here. */
    }
}

 

That's basically all I did, no component or other stuff added to the project.

Dev-System as described above!

Thanks to all of you, who are kind enough to all this ;)

Jings



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

QuickSilver posted on 10 Oct 2012 11:02 AM PST
Senior Member
19 Forum Posts

Have you disabled ECC? If yes, you need to call CySetFlashEEBuffer API before calling CyWriteRowData.



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

Bob Marlowe posted on 10 Oct 2012 11:34 AM PST
Top Contributor
1768 Forum Posts
In PSoC5 ECC IS disabled, so please use

 uint8 *HelpBuff; cystatus status; memset(buffer, 0x55, 256); HelpBuff = malloc(300); status = CySetFlashEEBuffer(HelpBuff); CySetTemp(); /* Write to flash => 0x6400 (Array=0, Row=100) */ status = CyWriteRowData(array_id, row, buffer); free(HelpBuff);

Bob

Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

Bob Marlowe posted on 10 Oct 2012 11:35 AM PST
Top Contributor
1768 Forum Posts

Fricken editor

 

uint8

 

 

*HelpBuff;

 

/* Write to flash => 0x6400 (Array=0, Row=100) */

Bob

status = CyWriteRowData(array_id, row, buffer);

 

free(HelpBuff);

cystatus status;

 

memset(buffer, 0x55, 256);

 

HelpBuff = malloc(300);

 

status = CySetFlashEEBuffer(HelpBuff);

 

CySetTemp();

 

 

 

 



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

Bob Marlowe posted on 10 Oct 2012 11:38 AM PST
Top Contributor
1768 Forum Posts

Nice, now all the lines are mixed with a single ctrl-V !

Take it as a puzzle and order them.

 

Bob



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

MasterJings posted on 11 Oct 2012 12:38 AM PST
Member
8 Forum Posts

Hey Bob,

thanks for your puzzle, I really loved it ;)

The CySetFlashEEBuffer()-function was the key. I looked it afterwards up in the System Reference Guide on page 56,

where it is explained, why it is used. Now I feel a little bit embarrassed because if I had read it carefully, I would have done it by my own ;(

But anyways, thanks for your support!

I almost love you ;)

Bye and greeting from Austria

Jings

 



Re: Bootloader-Problem => "CyWriteRowData() doesn't work?!

Bob Marlowe posted on 11 Oct 2012 01:48 AM PST
Top Contributor
1768 Forum Posts

@Jinx (smile)

If you hadn't had that issue I wouldn't have looked up the solution in the manual, so I've learnt something from your question too.

BTW: My daughter is wearing a t-shirt with "There are no Koalas in Austria". She's in Brisbaine right now.

 

Greetings from Germany

Bob

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20