cancel
Showing results for 
Search instead for 
Did you mean: 

Corrupt APBAHBPrescTable Array

daemonmaker
Associate II
Posted on October 16, 2010 at 07:57

Corrupt APBAHBPrescTable Array

2 REPLIES 2
Posted on May 17, 2011 at 14:11

If you want others to look at it you will need to zip up the whole project and attach it to your post.

If you have added or changed a lot of code, and it used to work, go back to where it worked and change things a little at a time until you identify where the problem is.

If it is corrupted from the beginning, check the code that is generated and walk through the initialization. Perhaps the compiler is not copying the statics into RAM. Use ''static const'' so that the table is in FLASH.

Check also that the peripherals and clocks are actually getting initialized. If the USART is not clocked, it's registers will not change. Using a JTAG probe and Keil uVision3 you would be able to examine the peripheral registers in the debugger.

If your tools aren't working for you, get some different ones that do.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
daemonmaker
Associate II
Posted on May 17, 2011 at 14:11

> If you want others to look at it you will need to zip up the whole project and attach it to your post.

Well, that's not what I was asking, I was more hoping to have a discussion about the potential problems so that I may practice debugging the issue. However since you requested it I've attached the code.

> If you have added or changed a lot of code, and it used to work, go back to where it worked and change things a little at a time until you identify where the problem is.

I'm way ahead of you. The table is corrupt before I make a single change to the example.

> If it is corrupted from the beginning, check the code that is generated and walk through the initialization. Perhaps the compiler is not copying the statics into RAM. Use ''static const'' so that the table is in FLASH.

This is a little more tricky for me because I'm new to working with an ARM processor. I have actually tried looking through the generated code but I don't understand what a lot of it is doing. Could you offer some pointers, more documentation, a book or a tutorial?

I went ahead and tried your suggestion of declaring the array ''static const'' but that had no effect.

> Check also that the peripherals and clocks are actually getting initialized. If the USART is not clocked, it's registers will not change. Using a JTAG probe and Keil uVision3 you would be able to examine the peripheral registers in the debugger.

I have also done this and all the registers appear correct. At least they're set as I expect them to be based on the code. Doing this is actually how I discovered that the APBAHBPrescTable array is corrupt. Maybe I'm missing something, does Keil uVision3 have some special access that GDB doesn't?

> If your tools aren't working for you, get some different ones that do.

I'm not sure why you think my tools are the problem. I've been able to do everything you suggest thus far. The problem, as I previously mentioned, is a general lack of experience. I am new to ARM development. I wouldn't know any better how to resolve this issue if I had any other tool.