CYPD4226-40LQXI_notebook01 sample project uses all SRAM resources

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

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

cross mob
Anonymous
Not applicable

Hi,

on my board I am using the CYPD4226-40LQXIT with 2 mux chips (TUSB1046-DCIRNQR). I also have the dev kit CY4541. To jump start the application development, I have loaded the CYPD4226-40LQXI_notebook01 sample project. I successfully complied it. However it uses almost all SRAM resources (8164 bytes of 8192 bytes used). I need to replace the mux init, to init my TUSB1046 devices. To be able to debug the code, I need to add code. But whatever I tried, I run out of SRAM and it does not compile anymore.

- I cannot add a software UART

- I cannot add I2C reads (of the mux chip registers)

Questions:

- how can I free up SRAM?

- do you have a sample project, which uses less SRAM?

- is it true that I cannot debug via single stepping and breakpoints (I am using the MiniProg3 for flashing via SWD)? I could not get it to work?

- how can I make use of the slave I2C interface which is connected to my host system? How can I load values into the slave I2C registers?

Thanks.

0 Likes
1 Solution
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi,

1. You do not need to try to fee up SRAM, since the CCG4 firmware have two parts: bootloader and application. All of application is stored in Flash.

2. All of example project have already released on website. If you want to free up some flash, you can open config.h and disable some features you do not want to.

3. You can debug firmware step by step with breakpoints and miniProg3. The only thing you need to do is debug the project with no_boot project.

4. You just need drag a I2C component into your project .cysch file. And configure the components as I2C slave. You can right click and open datasheet of components to get all of APIs to transmit I2C traffic. It is very easy to use and do not need to right registers by yourself.

Best Regards,

Lisa

View solution in original post

0 Likes
6 Replies
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi,

1. You do not need to try to fee up SRAM, since the CCG4 firmware have two parts: bootloader and application. All of application is stored in Flash.

2. All of example project have already released on website. If you want to free up some flash, you can open config.h and disable some features you do not want to.

3. You can debug firmware step by step with breakpoints and miniProg3. The only thing you need to do is debug the project with no_boot project.

4. You just need drag a I2C component into your project .cysch file. And configure the components as I2C slave. You can right click and open datasheet of components to get all of APIs to transmit I2C traffic. It is very easy to use and do not need to right registers by yourself.

Best Regards,

Lisa

0 Likes
Anonymous
Not applicable

Hi Lisa,

thank you for these recommendations.

1. my problem is not the flash. I only use about 70kbytes of the 128kbytes. I understand that the bootloader and program are stored in flash. My problem is that the sample application uses almost all of the SRAM. I guess this is used for variables and data structures. If i try to add a software UART, the sample project does not compile anymore as it runs out of SRAM. Please note that only a few bytes are left when compiling the sample (8164 of 8192 bytes used).

I have tried to add an I2C_read of my mux chip and again the compilation fails because of SRAM shortage. Whatever little code I try to add to the sample project, it fails as there is so little SRAM left.

So I definitely do need to free up SRAM.

2. I will try this.

3. Thank you for the "no_boot" hint. What does this mean exactly? I have tried to remove the bootloader component but then the compiler complains. Yesterday I have asked a very experienced ST Cortex-M0 programmer to assist me, and he was not able to get the project to debug. Normally he uses Atollic TrueStudio and it works just fine. There must be something special in your PS-Creator. Is there a step-by-step how-to debug?

4. the sample project already has the I2C slave component. And this is connected to my host system. My question is how I would interact with this slave controller? How can I load a data variable into a slave I2C "register" so that my host system can read it? How do I set up the I2C slave device? I guess it emulates a certain number of registers which can be read or written by the host system? How do I specify the number of registers?

Thanks.

0 Likes
Anonymous
Not applicable

Hi Lisa,

the AN210771 - Getting Started with EZ-PD™ CCG4 guide (http://www.cypress.com/file/283881/download) shows the HPI (host processor interface) register map on page 8 (see below). I guess this is how the host processor sees the I2C slave interface. There is a register space of 0 to 0x2FFF which is more than 12000 bytes. This is more that the entire SRAM of the CYPD4226 which has 8kbytes (8192 bytes). Is there a more detailed description of the register map? What do the 2 dark blue "data memory - 1 kbyte" sections consist of?

In my end product I do need the HPI. But for a test can I simply remove it, to free up resources? I have tried but it seems to have very many dependencies in the code. Alternatively, can I remove sections in the HPI register map, to free up SRAM? This HPI seems to bind quite a few SRAM resources.

Screen Shot 2018-12-29 at 09.56.59.png

0 Likes

Hi ,

If you are looking for HPI SPEC, you have to contact local Cypress FAE and signed NDA with Cypress to get those documentations. Thank you for your understanding.

Best Regards,

Lisa

0 Likes
Anonymous
Not applicable

Hi Lisa,

thank you for this info. Please also me with the other questions, mainly how to free up SRAM.

Best regards, Jurgen

0 Likes

Hi Jurgen,

As I said previous response, you can open config.h file and disable some features to free up it. You mentioned that you need add I2C components, you can try to add it.

Best Regards,

Lisa

0 Likes