Changing program start address - arm

I've exported mbed_blinky project for keil uvision 5 and i want to develop a program for another board, so I need to change the start address of program. I change the start in IROM1 in options for target window but it doesn't work. It must be defined in somewhere but I can't find it. Can anyone help?
My target is LPC1768

In uVision, the linker script (or scatter file as Keil refers to it) is either generated from the target settings that you have tried to change or can be overridden on the linker tab with a "scatter file"; it is possible that the mbed export does not generate a uVision target tab compatible scatter file or requires settings not available in uVision's basic target dialog, so is using a custom scatter file.
On the linker tab, check whether or not the "Use memory layout from target dialog" is checked or not. If you want to use the "Target" tab settings it must be checked, otherwise the file in the "Scatter file" setting on the linker tab is used and you will need to edit that, and check all other settings on teh linker tab are correct for your target..

I've used mbed in Eclipse/GCC and am less familiar with Keil. If you want to change target boards/micro's, you are better off doing a new Export from either the online compiler or from mbed-cli tool with the new target selected. The start address is only one of many things that have to change for a new target. The files required to compile for the new target are all on the disc inside the mbed-os folder, but when you exported the original project, they helpfully excluded unnecessary files from the project items. Files are on the disc, just not part of Keil project setup. You would have to also edit the Device on the options tab and the C/C++ include paths and compiler flags as these relate to specific target. Then you will need to locate the correct linker file and startup file for the new target. Again, it is easier to just export a new project for the new target.

Related

Change which file vscode opens when using "go to definition"

I'm using Visual Studio Code to manage a C project that contains a number of libraries and fully-linked executables. When the executables need to depend on headers from a library, rather that point at the library's source files directly, they point at a build directory containing the headers. That is, for a source layout like:
project/lib/src/lib.h
project/exe/src/exe.c
Rather than the build for project/exe including -I project/lib/src, it does -I project/lib/build, which will have a copy of lib.h in it from the last time the library was built. This is done for miscellaneous reasons that don't matter here, and mostly works fine, except when I use vscode's "Go to Definition" feature (F12, Ctrl+Click, etc.).
Because vscode is using the compiler's include path to know where to find headers, if I go to the definition of anything in lib.h, vscode will open project/lib/build/lib.h instead of project/lib/src/lib.h. Is there a way, either built-in or via a plugin, to hook vscode's belief that it should open project/lib/build/lib.h and change it to project/lib/src/lib.h? I'm even willing to write a plugin, but I couldn't find a way to either modify the language server's result to change the path, or intercept vscode attempting to open a particular path and change it on-demand.

Include tcl.h into C project

I need to use tcl.h in my C project (VS 2012) for registering function in SQLite. I have downloaded Tcl for windows and installed it. But my project still doesn't recognize when I write #include . What should I do to get access to this header?
Thanks in advance.
Open the project properties and do :
Right click on your project, go to properties, go to C/C++ session. On the field Additional Include Directories, add the path to the header you want, and use the header with "".
After that, you should go to the Linker session. On General, go to the Additional Library directories and add the path to the libs you need to add. Then go to Input and add the lib.
Sometimes you will need to copy a dll to the same folder of your executable. You can do that on Custom Build Step - Post Build Events.
You need to do it for each configuration and platform you want to build - one tip to make it easier is to use those variables $(Configuration) and $(Platform) when you are specifying the paths, and select on the dropdown list of the top of the properties window All configurations and All platforms, so you don't need to do it several times per project.

How to generate a MAP file in visual Studio

Generaly IDEs has option to generate MAP file which shows the locations of the functions and the variables across the memory and the STACK and RAM usages.
Where in Visual Studio Projects we can generate a MAP file and get this information.Especially the Stack and RAM statistics.
Maybe you want to take a look at the documentation.
The linker directive which will create a .map file is just,
/MAP[:filename]
and..
filename: A user-specified name for the mapfile. It replaces the default name.
found under https://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
This linker directive should be what you were looking for :).
Or better to be found under
Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
Click the Linker folder.
Click the Debug property page.
Modify the Generate Map File property.

Missing File Exceptions.h

I have just recently started using Atmel Studio 6 to program an SAM3S4A that I recently bought. When compiling, it states from inside the file "pio_handler.c" that the file "exceptions.h" is missing. There seem to be many copies of this same file lying around in various locations within the Atmel program files folder. Where can I find the correct copy of this file to include so that I may finally use this chip?
Try creating an Atmel board new project based on SAM3S4A. Once you have done it, go to:
src/asf/sam/utils/cmsis/sam3s/source into the Solution Explorer window.
Now make a copy of this directory structure in your won project.
Finally add each file.
Now do right click on you project name into Solution Explorer and select properties.
Select Toolchain from left side options. Now choose ARM/GNU C Compiler…Directories. Now add a new path pointing to:
../src/asf/sam/utils/cmsis/sam3s/source/templates
Build again

Eclipse: choosing a default debugger for all new C projects

Whenever I start a new project, I have to go through setting up the debugger with Eclipse time and time again before I can use it. Isn't there a default setting for all new C projects I can change?
I'm not sure exactly what you mean by "setting up the debugger" (perhaps you can clarify), but under "Preferences -> Run/Debug -> Launching -> Default Launchers" you should be able to select your preferred launcher for different kind of launch modes. This can also be selected individually for each launch configuration.
Typically it is up to the toolchain and/or project to determine which debugger/launcher is suitable to use for that specific project, but I know there is a bug in CDT which prevents toolchains from properly specifying the default launcher to use.
I only use Eclipse for Java, so I can't give you an authoritative answer. But since no one else seems to be answering:
Java projects have a (more or less) hidden file in the project directory called .project and another one called .settings . I'm not sure if this would apply to the C environment as well, but it seems likely. You may want to look at the set of such "hidden" files for a well set up project and a virginal project side by side to find out which settings make the difference.
Given that information, you may be able to simply edit (perhaps with some assistance from a script you can write yourself) the file(s) in question to do the configuration textually without a lot of mouse clicking.

Resources