Kinetis K60: code imported from TWR-K60D100M to circuit using MK60DX256VLL10

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

Kinetis K60: code imported from TWR-K60D100M to circuit using MK60DX256VLL10

Jump to solution
1,080 Views
hfabbasi
Contributor III

I have successfuly run Keil MDK codes provided in "SDK_2.2.0_TWR-K60D100M_board" on TWR-K60D100M-KIT. Now I am trying to write codes for my own design circuit which uses MK60DX256VLL10. In sample code of GPIO, PORTA11 in TWR-K60D100M is used to toggle LED on/off. Now in my own design circuit, same pin PORTA11 is used to toggle LED on/off. The problem is that the code is built successfuly in KEIL MDK 5.34 but when I press the debug button, the code debugs but instead of normal procedure (in which when debug is pressed, code enters in debug mode and you have to press RUN to run the code on your target ) the code shows RUN button as gray (as if without pressing the RUN button, code has entered RUN mode) but nothing happens on design circuit and when I press STOP button, the error appears ( error message is typed in bold as below to distiguish from my question)

Cannot access memory @0x2000fff8, Read, Acc Size: 4 Byte

Cannot access memory @0x2000fffc, Read, Acc Size: 4 Byte

'

'

'

Cannot access memory @0x20011f94, Read, Acc Size: 4 Byte 

 

I have tried to undesrstand this error. 20011f94 minus 2000fff8 = 1F9C = 8092 (decimal) = 8K memory.

 

Can anybody help me understand this error. Are there any special setting to change in code when exporting from TWR-K60D100M to  MK60DX256VLL10 (apart from target selection in Keil MDK). Project/Code is attached whic is very simple to understand so please have look at it.

0 Kudos
1 Solution
1,038 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

The project may use its own link file. You have to modify it.

jingpan_0-1623206193903.png

In the .scf file, you should modify these definiation.

#define m_interrupts_ram_start 0x1FFF8000
#define m_interrupts_ram_size __ram_vector_table_size__

#define m_data_start (m_interrupts_ram_start + m_interrupts_ram_size)
#define m_data_size (0x00008000 - m_interrupts_ram_size)

#define m_data_2_start 0x20000000
#define m_data_2_size 0x00008000

 

Regards,

Jing

View solution in original post

4 Replies
1,062 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi

MK60DX256VLL10 has only 64k SRAM while MK60DN512 has 128k SRAM.

Valid address ranges for SRAM_L and SRAM_U are defined as:
• SRAM_L = [0x2000_0000–(SRAM_size/2)] to 0x1FFF_FFFF
• SRAM_U = 0x2000_0000 to [0x2000_0000+(SRAM_size/2)-1]

So, 0x2000FFF8 is out of memory size.

Please change memory settings in KEIL.

 

Regards,

Jing

0 Kudos
1,056 Views
hfabbasi
Contributor III

When target is selected in Keil MDK it automatically adjust these things. Is this not the case? Attached two pictures show that the difference which you are suggesting is there when MK60DN512VMD10 is selected (which is used in development kit) as comapred to MK60DX256VLL10 (used in my circuit). Are there any other settings which needs changing in the code? Is this setting in Keil MDK's target selection enough? If there are changes needed to be done in the code, would you be so kind to point me in that direction.

0 Kudos
1,039 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

The project may use its own link file. You have to modify it.

jingpan_0-1623206193903.png

In the .scf file, you should modify these definiation.

#define m_interrupts_ram_start 0x1FFF8000
#define m_interrupts_ram_size __ram_vector_table_size__

#define m_data_start (m_interrupts_ram_start + m_interrupts_ram_size)
#define m_data_size (0x00008000 - m_interrupts_ram_size)

#define m_data_2_start 0x20000000
#define m_data_2_size 0x00008000

 

Regards,

Jing

1,023 Views
hfabbasi
Contributor III

Thank you for your help. It was really helpful. After this, code ran successfuly.

0 Kudos