Skip to content

Instantly share code, notes, and snippets.

View sidprice's full-sized avatar
💭
So much to learn ... what a cool life!

Sid Price sidprice

💭
So much to learn ... what a cool life!
View GitHub Profile
platforms/libftdi/gdb_if.c: In function ‘gdb_if_init’:
platforms/libftdi/gdb_if.c:48:2: error: unknown type name ‘WSADATA’; did you mean ‘CADATE’?
WSADATA wsaData;
^~~~~~~
CADATE
platforms/libftdi/gdb_if.c:49:2: error: implicit declaration of function ‘WSAStartup’; did you mean ‘LZStart’? [-Werror=implicit-function-declaration]
WSAStartup(MAKEWORD(2, 2), &wsaData);
^~~~~~~~~~
LZStart
@sidprice
sidprice / main.js
Created September 13, 2018 15:38
const electron = require('electron')
// Module to control application life.
const app = electron.app
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow
const path = require('path')
const url = require('url')
// Keep a global reference of the window object, if you don't, the window will
1. Start Cygwin
2. Ensure that the master branch of the repository is checked out
3. Mount the repository in the Cygwin environment.
a. mount c:/DataRoot/Projects/blackmagic ~/Projects/blackmagic
4. Navigate into the mounted project source
a. cd ~/Projects/blackmagic/src
5. Clean the build
a. make clean
6. Build the native platform
make
gpio_port_write (GPIOA, 0xA102);
gpio_port_write (GPIOB, 0x0000);
gpio_port_write (GPIOA, 0xA182);
gpio_port_write (GPIOB, 0x0002);
/* This needs some fixing... */
/* Toggle required to sort out line drivers... */
gpio_port_write(GPIOA, 0x8102);
gpio_port_write(GPIOB, 0x2000);
gpio_port_write(GPIOA, 0x8182);
gpio_port_write(GPIOB, 0x2002);
PS C:\DataRoot\Projects\blackmagic\scripts> python .\stm32_mem.py ..\src\blackmagic.bin
USB Device Firmware Upgrade - Host Utility -- version 1.2
Copyright (C) 2011 Black Sphere Technologies
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Found Black Sphere Technologies
Device ID: 1d50:6017
Manufacturer: b'Black Sphere Technologies'
Product: b'Black Magic Probe (Upgrade)'
(gdb)
load
&"load\n"
~"Loading section .isr_vector, size 0x1c8 lma 0x8000000\n"
+download,{section=".isr_vector",section-size="456",total-size="437540"}
+download,{section=".isr_vector",section-sent="456",section-size="456",total-sent="456",total-size="437540"}
~"Loading section .text, size 0x15dfc lma 0x80001d0\n"
+download,{section=".text",section-size="89596",total-size="437540"}
+download,{section=".text",section-sent="3008",section-size="89596",total-sent="3464",total-size="437540"}
+download,{section=".text",section-sent="6016",section-size="89596",total-sent="6472",total-size="437540"}
Updating the firmware on Windows requires a driver installation and the use of a tool called DF-Util.
The driver (on Windows 10) is installed using a utility from http://zadig.akeo.ie/. Black Magic Probe uses a driver called libusbK, a selection offered by the Zadig tool.
In a command window then execute the following command:
dfu-util.exe -d 1d50:6018,:6017 -E 20 -s 0x08002000:leave -D blackmagic.bin
Notes:
1. BMP will enter DFU mode but may not have a driver installed. If that is the case install a driver for the update device using Zadig and run the above command again.
void (*SysMemBootJump)(void);
volatile uint32_t addr = 0x1FFF0000;
/* Jump to the built in bootloader by mapping System flash */
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_SYSCFGEN);
SYSCFG_MEMRM &= ~3;
SYSCFG_MEMRM |= 1;
/*
set the jump address
*/
SysMemBootJump = (void (*)(void)) (*((uint32_t *) (addr + 4)));
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.