有关McuXpresso的使用

cancel
Showing results for 
Search instead for 
Did you mean: 

有关McuXpresso的使用

214 Views
Contributor II

在使用KV30F128芯片进行开发时,使用McuXpresso建立工程后碰到以下问题:
1.Mcuxpresso在Debug调试时,程序指令是指向Main函数首地址,可以改配置能让它指向芯片复位后的地址,比如指到ResetISR处吗。
2.如果上电后需要改动配置,把代码从Flash拷贝到特定的RAM区,比如拷贝到SRAM_LOWER区或者SRAM_UPPER区后再执行,需要怎样改动配置?
3.使用Keil进行开发时,发现Keil中使用的芯片库函数和Mcuxpresso中使用的库函数不一样,如果需要使用Keil开发,能提供一个基于Keil开发的工程吗?

0 Kudos
5 Replies

28 Views
NXP TechSupport
NXP TechSupport

楼主你好,回答你的几个问题:

1.Mcuxpresso在Debug调试时,程序指令是指向Main函数首地址,可以改配置能让它指向芯片复位后的地址,比如指到ResetISR处吗。
答:请看下面的图片, 在debug configuration里面设置,把set breakpoint at main, 改成ResetISR。

pastedImage_1.png

2.如果上电后需要改动配置,把代码从Flash拷贝到特定的RAM区,比如拷贝到SRAM_LOWER区或者SRAM_UPPER区后再执行,需要怎样改动配置?

答:参考官方代码startup_<chip partnumber>.c

    //
    // Copy the data sections from flash to SRAM.
    //
    unsigned int LoadAddr, ExeAddr, SectionLen;
    unsigned int *SectionTableAddr;

    // Load base address of Global Section Table
    SectionTableAddr = &__data_section_table;

    // Copy the data sections from flash to SRAM.
    while (SectionTableAddr < &__data_section_table_end) {
        LoadAddr = *SectionTableAddr++;
        ExeAddr = *SectionTableAddr++;
        SectionLen = *SectionTableAddr++;
        data_init(LoadAddr, ExeAddr, SectionLen);
    }
3.使用Keil进行开发时,发现Keil中使用的芯片库函数和Mcuxpresso中使用的库函数不一样,如果需要使用Keil开发,能提供一个基于Keil开发的工程吗?

答:请下载SDK 包,IDE选择keil。

https://mcuxpresso.nxp.com/

pastedImage_3.png

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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

28 Views
Contributor II

感谢回复:

在第二点中,这段在函数ResetISR中的代码将程序拷贝到了RAM区,但函数中间的几个变量是在哪里定义和更改的呢,目前好像是工程建立后就给这几个变量赋值到了Flash和RAM首地址?

pastedImage_1.png

0 Kudos

28 Views
NXP TechSupport
NXP TechSupport

你可以随便打开一个SDK工程, 然后搜索下这些变量就知道了,请直接参考官方的代码。

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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

28 Views
Contributor II

我是在mcuxpreeso中新建的一个工程,在工程中并没有搜索到这几个变量的定义,只看到了这几个变量的extern 声明。

另外从官网上down下来的基于IAR和KEil的SDK,把board里面的工程打开后,启动文件都是MKV31F512芯片,而非我下载的MKV30F128芯片的启动文件。工程路径如下所示:

pastedImage_1.png

Keil中的工程直接编译后还会报警,提示启动文件起始行不正确?是因为Keil版本的问题?

pastedImage_2.png

0 Kudos

28 Views
NXP TechSupport
NXP TechSupport

楼主你好!

你打开官方的hello_world工程,在变量定义上面有这段话:

//*****************************************************************************
// The following symbols are constructs generated by the linker, indicating
// the location of various points in the "Global Section Table". This table is
// created by the linker via the Code Red managed linker script mechanism. It
// contains the load address, execution address and length of each RW data
// section and the execution and length of each BSS (zero initialized) section.
//*****************************************************************************

所以说明是linker文件里面定义的,你再打开frdmkv31f_hello_world_debug.ld

pastedImage_1.png

希望能帮到你!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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