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.

TMS320F28379D: Programming EMU_BOOTCTRL directly in code

Part Number: TMS320F28379D
Other Parts Discussed in Thread: SYSCONFIG

Hello,

Is it possible to program EMU_BOOTCTRL directly on C code? I'm trying to write this configuration (based on this thread):

#include "driverlib.h"
#include "device.h"
#include "board.h"

*(uint32_t *)0x0D00 = 0x28270B5A;

However, the compilation is failing and here is an excerpt of the build console:

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

I'm currently changing the boot configuration via Memory Browser, and then resetting the CPU (as suggested here). But it will be easier to have this settings right in the beginning of the debug session.

Thank you in advance.

  • Hello Fabricio,

    Is it possible to program EMU_BOOTCTRL directly on C code? I'm trying to write this configuration (based on this thread):

    Based on your code snippet it looks like you're trying to write directly to the address, and this may be causing the syntax compiler error message you're seeing. Can you just try to use a temporary pointer instead and write to the pointer? Something like this:

    uint16_t *ptr;
    ptr = (uint32_t *)0x0D00;
    *ptr = 0x28270B5A;

    Best regards,

    Omer Amir

  • Hi Omer,

    You're right. Since this is the boot configuration I would like to use, I'm trying to initialize this value, and as far as I know, if this statement is inside main() it will be "too late" to write. So, I'm trying to declare this as global. And thus, I had some issues with the code you provided, and still got errors:

    "../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

    The procedure I usualy use is to start the debugger, set the values I want in the memory browser, reset the CPUs and than run to main. Although this method is not that time consuming, It would be great to start the debug session with de boot values that I want, right on the first run.

    I must say that I don't need that the solution be really like this. If you have any other procedure to start the EMU_BOOTCTRL configured, it will be welcome.

    Grateful,
    Fabrício

  • You're right. Since this is the boot configuration I would like to use, I'm trying to initialize this value, and as far as I know, if this statement is inside main() it will be "too late" to write. So, I'm trying to declare this as global. And thus, I had some issues with the code you provided, and still got errors:
    The procedure I usualy use is to start the debugger, set the values I want in the memory browser, reset the CPUs and than run to main. Although this method is not that time consuming, It would be great to start the debug session with de boot values that I want, right on the first run.

    I understand now, this value in memory is something that needs to be set before the code is run. I don't believe there's any way to do this outside of a function, I think this is a C limitation more than it is a device limitation since this can be done through the debugger. Given the requirement that this code would need to be executed before main is run, I don't think this is possible.

    I will forward this question to another expert to see if there is an alternate procedure to start the EMU_BOOTCTRL configured.

  • Hi Fabrico,

    The Boot ROM reads the EMU_BOOTCTRL only if the JTAG is connected and only during the boot process BEFORE the application. Any setting after the boot process is not applicable.

    Regards,
    Kedar