iMXRT1064 Emwin Demo 16 bpp

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMXRT1064 Emwin Demo 16 bpp

2,143 Views
anujtanksali
Contributor II

I have a Emwin Demo SDK code generated for iMXRT EVK 1064 board.  I am using MCUXpresso 11.1 version with SDK 2.7.0

The Emwin Demo default LCD configuration is for 32 bit mode i.e. LCD_BITS_PER_PIXEL is 32. I am using 2 LCD buffers. When i change LCD_BITS_PER_PIXEL to 16 bit i get linker error regarding memory as NCACHE_REGION is only 2MB and BOARD_SDRAM region is 30MB. (Error: section `.bss_RAM2' will not fit in region `NCACHE_REGION')

Following is the summary of settings

NCACHE_REGION         BOARD_SDRAM        LCD_BITS_PER_PIXEL             Debug

30 MB                                    2 MB                                        16                          program crashes **

2 MB                                       30 MB                                      32                          success  

** runs ok when MCUXpresso 10.3 and SDK 2.6.1.

So what is the ideal BOARD_SDRAM and NCACHE_REGION memory settings for 16 bits per pixel on MCUXpresso 11.1 and SDK 2.7.0

Thanks

Anuj

Labels (1)
0 Kudos
Reply
10 Replies

1,869 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj Tanksali ,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I think I need more information about the issue, so I was wondering if you can introduce what demo project you use and the exact modification you do about the demo. In addition, the testing flow.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,869 Views
anujtanksali
Contributor II

Hello jeremyzhou

The project i am using is evkmimxrt1064_Emwin_emwin_gui_demo. 

I have changed the following code for backlight to make it work on my prototype board.

emwin_support.h

LCD.PNG

pastedImage_5.png

main.c (commented i2c init as not used in our prototype board)

pastedImage_6.png

I also observed that with the below configuration the program sometimes crashes

NCACHE_REGION         BOARD_SDRAM        LCD_BITS_PER_PIXEL             Debug

2 MB                                       30 MB                                      32                          success  

To resolve this i comment the lines related to multi buffer begin and end. 

pastedImage_7.png

The project is attached for your reference.

Thanks

Regards,

Anuj

0 Kudos
Reply

1,869 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj Tanksali ,

Thanks for your reply.
First, I've not encountered the crash error after modifying the code as you introduced.
Secondly, Fig 1 presents the memory allocation, it divides the external SDRAM into two parts.

pastedImage_1.png

However, in the BOARD_ConfigMPU() function, it doesn't have the attribute configuration of the NCACHE_REGION, so it should add the below code in the  BOARD_ConfigMPU() function.

    /* Region 8 setting, set last 2MB of SDRAM can't be accessed by cache, glocal variables which are not expected to be
     * accessed by cache can be put here */
    /* Memory with Normal type, not shareable, non-cacheable */
    MPU->RBAR = ARM_MPU_RBAR(8, 0x81E00000U);
    MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_2MB);

Next, there's no ideal proportion of the BOARD_SDRAM and NCACHE_REGION memory areas actually, it should be determined by the exact demo project.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,869 Views
anujtanksali
Contributor II

Hello jeremyzhou

Thanks for the reply.

Do you mean to say if SDRAM memory configuration is changed then the MPU configuration also should be changed manually as it is not updated automatically.

Regards

Anuj

0 Kudos
Reply

1,869 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj Tanksali ,

Thanks for your reply.

1) Do you mean to say if SDRAM memory configuration is changed then the MPU configuration also should be changed manually as it is not updated automatically?
-- Yes.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,869 Views
anujtanksali
Contributor II

Hello jeremyzhou

My memory configuration is 

pastedImage_2.png

and as per my memory configuration the changes in MPU init code are below,

pastedImage_6.png

my program when debugged crashes. LCD blinks 2-3 times before crashing. 

I debugged the program and found out issue is with mutibuffer. if i comment out code as shown below then program runs fine

pastedImage_5.png

What could be the reason for this?

Thanks

Regards

Anuj

0 Kudos
Reply

1,869 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj Tanksali ,

Thanks for your reply.

Sorry for late.
After reviewing the code, to be honest, I have no idea about the phenomenon now, as I've not found something wrong in the codes, in further, I can't replicate this phenomenon on my board and it makes it hard to figure it out. So I was wondering if you can find how to replicate the issue with the default LCD (480x272) panel, it will be great when doing it.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,869 Views
anujtanksali
Contributor II

Hello jeremyzhou

Thanks for your reply. 

I observed that the code somehow works on the iMXRT1064 EVK board but having the above issue only on my prototype board.

The differences that i observed between the two are 

1) EVK board uses internal power supply DCDC but prototype board does not.

2) The LCD pins are connected as below in prototype board,

pastedImage_1.png

as you can see GPIO_B0_15 is left out. but i think this should not cause an issue. 

On EVK board this pin is used.

Could any of the above options cause an issue?

Regards,

Anuj

0 Kudos
Reply

1,869 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj Tanksali,

Thanks for your reply.
1) Could any of the above options cause an issue?
-- In basic, I agree with your opinion, however, I'd like to suggest to copy the LCD panel hardware design of the MIMXRT1064 board if selecting the RGB565 format.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,869 Views
anujtanksali
Contributor II

Hi jeremyzhou

I may have found the issue causing this. As the SDK was updated to 2.7.0 some of old SDK 2.6.1 files were still present. 

When i took a new sample project from the new SDK 2.7.0 it worked fine on my hardware.

Thanks 

Regards,

Anuj