Author Topic: L1 cache causing error in bootloader  (Read 2337 times)

0 Members and 1 Guest are viewing this topic.

Offline jtronixTopic starter

  • Regular Contributor
  • *
  • Posts: 125
L1 cache causing error in bootloader
« on: April 13, 2016, 11:25:14 am »
I'm working with renesas RZ A1H cortext A9 processor and i have one problem with Boot loader. In boot loader if L1 cache is initialize then it wont jump to the user application and it stuck after jump function. also I'm initializing L1 cache again in my user application.
Everything works fine if L1 cache is not initialize in bootloader.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7306
  • Country: nl
  • Current job: ATEX product design
Re: L1 cache causing error in bootloader
« Reply #1 on: April 13, 2016, 11:29:06 am »
If this is just a "public announcement", then I would like to add, that the ART accelerator, which is a cache to the Flash on the STM32 MCUs, also cause issues when bootloading.
I would just turn off any caching on any architecture when bootloading.
 

Offline jtronixTopic starter

  • Regular Contributor
  • *
  • Posts: 125
Re: L1 cache causing error in bootloader
« Reply #2 on: April 13, 2016, 11:33:28 am »
How to overcome this issue of cache?? In bootloader i need cache to perform operation faster but it wont booting my application.
Is there any steps that needed before jumping to the user application???
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7306
  • Country: nl
  • Current job: ATEX product design
Re: L1 cache causing error in bootloader
« Reply #3 on: April 13, 2016, 11:47:16 am »
On that MCU the issue was:
10 The MCU was containing code.
20 We overwrote the Flash.
30 We were expecting that the new code will be excecuted, but the old was, since it was in the cache

The solution was to 25 flush the cache. Or to turn it off if possible.


« Last Edit: April 13, 2016, 11:49:14 am by NANDBlog »
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: L1 cache causing error in bootloader
« Reply #4 on: April 13, 2016, 01:22:03 pm »
On some architectures, the caches contains random garbage on powerup and needs to be cleared before being enabled.

Offline jtronixTopic starter

  • Regular Contributor
  • *
  • Posts: 125
Re: L1 cache causing error in bootloader
« Reply #5 on: April 14, 2016, 04:09:21 am »
do you have cache flush assembly code for cortex A9 processor or programming guide ?
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: L1 cache causing error in bootloader
« Reply #6 on: April 14, 2016, 05:11:46 pm »
You can probably find code easily on the net (eg. any open-source OS that supports the Cortex-A9). The cache maintenance operations are performed via CP15, and are documented in the ARMv7-A architecture reference manual, and the Cortex-A9 technical reference manual for the core-specific bits.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf