This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
是否可以直接在 C 代码上对 EMU_BOOTCTRL 进行编程? 我正在尝试 编写此配置(基于 该线程):
#include "driverlib.h" #include "device.h" #include "board.h" *(uint32_t *)0x0D00 = 0x28270B5A;
但是、 编译失败、以下是编译控制台的摘录:
>> Compilation failure subdir_rules.mk:9: recipe for target 'led_ex2_sysconfig_cpu1.obj' failed "../led_ex2_sysconfig_cpu1.c", line 73: error #18: expected a ")" "../led_ex2_sysconfig_cpu1.c", line 73: warning #78-D: this declaration has no storage class or type specifier "../led_ex2_sysconfig_cpu1.c", line 73: error #102: "uint32_t" has already been declared in the current scope "../led_ex2_sysconfig_cpu1.c", line 73: error #66: expected a ";" 3 errors detected in the compilation of "../led_ex2_sysconfig_cpu1.c".
我当前正在通过存储器浏览器更改引导配置、然后复位 CPU ( 如此处建议)。 但在调试会话开始时使用此设置会更容易。
提前感谢您。
Fabricio、您好!
[quote userid="585146" url="~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1295944/tms320f28379d-programming-emu_bootctrl-directly-in-code 是否可以直接在 C 代码上对 EMU_BOOTCTRL 进行编程? 我正在尝试 编写此配置(基于 此线程):根据您的代码片段、似乎您正在尝试直接写入该地址、这可能会导致您看到语法编译器错误消息。 您是否可以尝试改用临时指针并写入指针? 可表示为:
uint16_t *ptr; ptr = (uint32_t *)0x0D00; *ptr = 0x28270B5A;
此致、
阿米尔·奥马尔
您好、Omer:
你是对的。 由于这是我想要使用的引导配置,我正在尝试初始化这个值,据我所知,如果这个语句在 main ()里面,写入将会"太晚"。 我尝试将其声明为全局变量。 因此、我对您提供的代码有一些问题、但仍然有错误:
"../led_ex2_sysconfig_cpu1.c", line 79: warning #78-D: this declaration has no storage class or type specifier "../led_ex2_sysconfig_cpu1.c", line 79: error #148: declaration is incompatible with "uint16_t *ptr" (declared at line 78) "../led_ex2_sysconfig_cpu1.c", line 79: warning #145-D: a value of type "uint32_t *" cannot be used to initialize an entity of type "uint16_t *" "../led_ex2_sysconfig_cpu1.c", line 80: warning #78-D: this declaration has no storage class or type specifier "../led_ex2_sysconfig_cpu1.c", line 80: error #148: declaration is incompatible with "uint16_t *ptr" (declared at line 79) "../led_ex2_sysconfig_cpu1.c", line 80: error #150: variable "ptr" has already been initialized "../led_ex2_sysconfig_cpu1.c", line 80: warning #145-D: a value of type "long" cannot be used to initialize an entity of type "uint16_t *" "../led_ex2_sysconfig_cpu1.c", line 80: warning #154-D: conversion of nonzero integer to pointer
我通常使用的过程是启动调试器、在内存浏览器中设置所需的值、复位 CPU、然后运行到 main。 尽管此方法不是很耗时、但最好是在第一次运行时立即使用我需要的 DE 引导值启动调试会话。
我必须说、我不需要解决方案真正像这样。 如果您有任何其他过程来启动配置了 EMU_BOOTCTRL、我们欢迎采用这种方法。
感激之情、
Fabrício
您答对了。 由于这是我想要使用的引导配置,我正在尝试初始化这个值,据我所知,如果这个语句在 main ()里面,写入将会"太晚"。 我尝试将其声明为全局变量。 因此,我在您提供的代码上有一些问题,但仍然有错误:
我通常使用的过程是启动调试器,设置我需要在内存浏览器中设置的值,重置 CPU,然后再运行到 main。 尽管这种方法不是很耗时,但最好是在第一次运行时使用我需要的 DE BOOT 值启动调试会话。
现在我明白了、在运行代码之前、需要对存储器中的这个值进行设置。 我不认为在函数之外有任何方法可以做到这一点、我认为这不仅仅是一个器件限制、而是一个 C 限制、因为这可以通过调试器来实现。 鉴于要求在运行 main 之前执行此代码、我认为这是不可能的。
我会将此问题转交给另一位专家、看看是否有替代程序可启动已配置的 EMU_BOOTCTRL。
尊敬的 Fabrico:
仅当连接了 JTAG 并且仅在应用前的引导过程中、引导 ROM 才会读取 EMU_BOOTCTRL。 引导过程后的任何设置均不适用。
此致、
凯达