What's the role of the memory address 0x4000 0000 on the LPC546xx?

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

What's the role of the memory address 0x4000 0000 on the LPC546xx?

2,409 Views
jaroslaw_gorski
Contributor I

On reset, 0x4000’0000 = 0x0, and the vector table contains addresses in the boot rom area starting at 0x0300 0000. 

We need to set address 0x4000’0000 to 0x02 using the debug interface in order for the interrupt vector table to point

to locations in the flash memory where the user  program is.

 In both cases the VTOR register reads 0.

Also when the 0x4000’0000 = 0x0 the user program generates an exception when writing

to addresses other than >= 0xe000 0000 including the internal RAM memory.

 

What's the role of the memory address 0x4000 0000 on the LPC546xx?

Labels (1)
0 Kudos
15 Replies

2,131 Views
lpcxpresso_supp
NXP Employee
NXP Employee

It sounds to me like your debug tools are not correctly triggering a reset after programming flash - which will ensure that the boot rom is correctly run and configures the MCU fully before branching to your application in flash. If you can provide details of the tools that you are using, someone with appropriate knowledge may be able to help further with your setup.

But I can tell you that on many other LPC devices, the first register in address map of SYSCON is SYSMEMREMAP. Here is the info from the LPC845 user manual on it ....

pastedImage_1.png

 

Regards,

MCUXpresso IDE Support

0 Kudos

2,131 Views
jaroslaw_gorski
Contributor I

Thank you for your reply.

Any chance I can get similar documentation for the register at 0x4000 0000 on the LPC546xx?

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thanks for your reply.

Unfortunately, we don't have the document for you.
Maybe you can try to create a case to sign NDA to apply for this document.

Have a great day,
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

2,131 Views
jaroslaw_gorski
Contributor I

So what's the function of the register at 0x4000 0000 address and why does it need to be initialized

to 0x02 by the debugger? Is any documentation for it available?

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thanks for your reply.
The Syscon registers' address starts from the 0x4000_0010, in other words, there's no register on the 0x40000000 and it seems like the reserved area, you needn't care about it.
Hope this is clear.
Have a great day,
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

2,131 Views
jaroslaw_gorski
Contributor I

Hello,

Thank you for your reply.

I know that the area that starts at 0x4000 0000 is marked as reserved. That's clearly

documented. However I am not able to debug any programs if the debugger doesn't

set the location 0x4000 0000 to 0x02. Therefore I do need to care about it. Is this location

used by NXP boot loader firmware? What is its function?

If this is a proprietary information, can you contact me by email directly or can you put

me in contact with someone at NXP who is familiar with this please?

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thanks for your reply.
According to your introduction, it means that it needs to set the 0x4000_0000 to 0x2 manually prior to enter debug mode.
It makes me a bit confused, so  I was wondering if you can introduce the debug process you did.

Have a great day,
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

2,131 Views
jaroslaw_gorski
Contributor I

Entering the debug mode is not the problem, entering the debug mode works but debugging is not possible.

There are two problems and both are outlined above, in short:

1. the vector table contains addresses in the boot rom area starting at 0x0300 0000, therefore  user interrupts won't work

2. the user program generates an exception when writing to addresses other than >= 0xe000 0000 including the internal RAM memory so the user program will crash at the first write attempt to any address < 0xe000 0000.

Both problems don't exist if the debugger writes 0x02 to address 0x4000 0000.

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thanks for your reply.
I've run some SDK library's demos on LPC54608 and LPC54628 boards for testing, I can debug these demos in the MCUXpresso or IAR successfully, don't encounter the phenomenon you mentioned.
By using the memory monitor, I find that the default value of 0x4000 0000 is 0x02, it doesn't need to be set manually.
Hope this is clear.
Have a great day,
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

2,131 Views
jaroslaw_gorski
Contributor I

The debugger you use is writing 0x02 to 0x4000 0000 address before it lets you debug the program, you are just not aware of it. The default is 0x00 not 0x02.

I think it's about time to elevate this case to someone who is familiar with this.

I'd appreciate a little more help from NXP. I need an answer to a simple question:

"what is the function of the register at 0x4000 0000 address?"

Is there anybody at NXP who knows the answer?

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thanks for your reply.

The default the 0x40000000 is 0x02 (Fig 1), maybe you can show the testing result you do.

pastedImage_2.png

Fig 1

Have a great day,
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

2,131 Views
jaroslaw_gorski
Contributor I

How can you tell the default is 0x02? Any chance your debugger wrote 0x02 to the register at 0x4000 0000

upon connection to the target so that's the value you read? You can try it yourself if you have access

to the Lauterbach debugger. As far as I can tell it doesn't initialize the location 0x4000 0000 upon connection

to the target.

But that is not the point. The point is that there is a register at address 0x4000 0000

which strongly affects the operation of the microcontroller and it's not documented.

Can you find out and let me know what the function of that register is?

When you do that you will know exactly what the default value is as well.

Does that register affect only the boot software or does it have a 'hardware' function as well?

Perhaps it only affects the debugger cell in the microcontroller.

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thanks for your reply.
1) How can you tell the default is 0x02?
-- I read the value of 0x4000_0000 via the J-link tool, even if the J-link tool may write the 0x02 to the register at the 0x4000_0000 upon connection to the target, it doesn't matter, it doesn't need the customers to do additional work to enable debug feature and they aren't necessary to worry about that. If that, it means that the 0x4000_0000 register is a reserved area for NXP internal use only.
I'll contact the AE team to confirm this and inform you later

Have a great day,
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

2,131 Views
jaroslaw_gorski
Contributor I

Can you share the details of the register at 0x4000 0000 address yet?

0 Kudos

2,131 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jaroslaw Gorski ,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
Firstly, the 0x4000_0000 area is not assigned to the memory likes the Flash or RAM, this area point to APB peripherals, like the Fig1 illustrates.

pastedImage_1.png

Fig 1


Have a great day,
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