How do I build an example program using VSCode?

Excellent explanation.

This also helps me as I would like to compile using GCC and been having problems.

Just for completeness, I thought to mention that you can also add in the rom and ram settings inside mbed_app.json rather than amend targets.json.

{
	"target_overrides": {
		"MAX32620FTHR": {
			"target.mbed_rom_start": "0x00000000",
			"target.mbed_rom_size": "0x00200000"
			"target.mbed_ram_start": "0x20000000",
			"target.mbed_ram_size":  "0x00040000"
		}
	},
    }
}

I tried adding those directives to the MAX32620FTHR section of mbed-os/targets/targets.json, and it made no difference in the output bin file size (I backed out the ASM fix to be sure).

I conclude that I did not understand exactly where to place those directives, or I am still leaving something important out. Here is an excerpt including that addition:

"MAX32620FTHR": {
    "inherits": [
        "Target"
    ],
    "core": "Cortex-M4F",
    "comment": "HLH Added per https://forums.mbed.com/t/how-do-i-build-an-example-program-using-vscode/18380/14",
    "mbed_rom_start": "0x00000000",
    "mbed_rom_size": "0x00200000",
    "mbed_ram_start": "0x20000000",
    "mbed_ram_size": "0x00040000",
    "macros": [

Yes, it has no impact to your problem, because how I wrote above, there were a misunderstanding.

It has no impact to your issue, but from my point of view you placed it correctly. However, how Geriko pointed, it can be also overridden via mbed_app.json.

@gerriko thank you for the feedback.

BR, Jan

1 Like

Just to confirm whether I understood the fix that Jamie committed to the repository for startup_max32620.S (deletes a section at the top of the file) – is that the correct fix?

I did not understand the additions to the targets.json file – do I need to put those in my build also, or can I just leave those out?

Jamie did the correct fix. The rest is not necessary (if you do not want to do something with bootloader).

BR, Jan