How can I change the register content in ICD session

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

How can I change the register content in ICD session

1,067 Views
bressan
Contributor III

Using MCUXpresso, how can I change the register content of GPIO registers for example, during a ICD(in circiut debugging) session?
While debugging a running system (halted by breakpoint), I want to click somewhere or change a register entry manually and see, what happens with my in/output pins.

I can see the pin states, but don't know how to change them.

Tags (1)
0 Kudos
6 Replies

972 Views
bressan
Contributor III

Ok issue for GPIO was that I was used other behavior from LPC17xx. Now I'm able so set and read during ICD. Just missing the comfortable check boxes from uVision, where it was possible so (re)set single bits (pins).

Now I know how to control and read the pins of LPCxx, thanks.

0 Kudos

972 Views
bressan
Contributor III

It seems, it's just NOT possible to change any RAM memory randomly via ICD. Knowing the location of the data isn't enough, you must use a defined local or global variable to access the RAM. But then it's quite comfortable.

0 Kudos

972 Views
Sabina_Bruce
NXP Employee
NXP Employee

As stated by ConVerse, you can use the peripheral view. This is the tab located to the project explorer on the top left. Once you click the peripheral you would like to use, the memory viewer of the registers and their content will open on the bottom right.

MCUXPRESSO  UG

pastedImage_1.png

Best Regards,

Sabina

0 Kudos

972 Views
converse
Senior Contributor V

This is exactly what the "Peripherals" view in the debugger is for. Take a look at Chapter 12 (Debugging) section 8 (Peripherals) in the MCUXpresso User Guide for information on how this works (hint - its trivial!)

0 Kudos

972 Views
bressan
Contributor III

Thanks for your answer. I was already able to change a variable, which is available in source code. But I can't change a value in memory for example:
I add a memory monitor with address &var1. There I can't change the value of the RAM content.

It's a LPC55Sxx

I tried a little bit, and discovered, I can't set GPIO.DIR1 directly, but there is a seperate GPIO.DIR1SET, when I write there, the GPIO.DIR1 changes. Also IOCON is modifyable, it just takes some time to change the value.

I'm still not able to change memory content directly.

0 Kudos

972 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Bernahrd,

Hope you are doing well.

I created a small example to show you. Using MCUxpresso IDE.I created a simple adding function with the inital values as zero. Then I pause the execution using a breakpoint, before printing the value of var1, I change it to 20.

pastedImage_1.png

I step through again, you can see that the value 20 is printed and the sum of 20+0 is 20.

pastedImage_2.png

If the variables you are using are local variables you can use the same tab, next to the quickstart panel. If you are using global variables you can find it  on the right hand side of the IDE.

pastedImage_5.png

Hope this helps.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos