kopia lustrzana https://github.com/stlink-org/stlink
[patch] bug fixes and documentation improvements by Greg Alexander
rodzic
ad2470d0eb
commit
189d33c0db
|
@ -32,7 +32,7 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", \
|
|||
# Other possible settings:
|
||||
# OPTIONS="last_rule", ATTRS{vendor}=="STM32"
|
||||
|
||||
KERNEL=="sg[0-9]*", STLINK=="1", MODE="0664", GROUP:="tape", \
|
||||
KERNEL=="sg[0-9]*", MODE="0664", GROUP:="tape", \
|
||||
NAME+="stlink-sg%n", SYMLINK+="stlink", \
|
||||
ENV{UDISKS_PRESENTATION_HIDE}:="1", \
|
||||
ENV{UDISKS_PRESENTATION_NOPOLICY}:="1", \
|
||||
|
|
1
AUTHORS
1
AUTHORS
|
@ -2,3 +2,4 @@ Martin Capitanio <m@capitanio.org>
|
|||
Spencer Oliver <spen@spen-soft.co.uk>
|
||||
Le Mentec Fabien <fabien.lementec@gmail.com>
|
||||
Peter Zotov <whitequark@whitequark.org>
|
||||
Greg Alexander <grestm@galexander.org>
|
||||
|
|
11
README
11
README
|
@ -40,6 +40,17 @@ $ udevadm control --reload-rules
|
|||
Udev will now create a /dev/stlink file, which will point at appropriate
|
||||
/dev/sgX device. Good to not accidentally start debugging your flash drive.
|
||||
|
||||
Setting up modprobe rules
|
||||
=========================
|
||||
|
||||
You may install a modprobe rules file, stlink.modprobe.conf, located in
|
||||
the root of the repository. You will need to copy it to /etc/modprobe.d
|
||||
and then
|
||||
$ rmmod usb-storage
|
||||
If you have usb-storage built as a module, then this will cause it to be
|
||||
loaded with a "quirks" parameter that will cause it to ignore the STLink,
|
||||
rather than causing repeated errors and resets.
|
||||
|
||||
Running programs from SRAM
|
||||
==========================
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ start:
|
|||
packet_buffer[packet_idx] = 0;
|
||||
*buffer = packet_buffer;
|
||||
|
||||
return packet_size;
|
||||
return packet_idx;
|
||||
}
|
||||
|
||||
// Here we skip any characters which are not \x03, GDB interrupt.
|
||||
|
|
|
@ -46,7 +46,7 @@ struct chip_params {
|
|||
};
|
||||
|
||||
int serve(struct stlink* sl, int port);
|
||||
char* make_memory_map(const struct chip_params *params, uint16_t flash_size);
|
||||
static char* make_memory_map(const struct chip_params *params, uint32_t flash_size);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if(argc != 3) {
|
||||
|
@ -87,7 +87,7 @@ int main(int argc, char** argv) {
|
|||
printf("Device parameters: SRAM: 0x%x bytes, Flash: up to 0x%x bytes in pages of 0x%x bytes\n",
|
||||
params->sram_size, params->max_flash_size, params->flash_pagesize);
|
||||
|
||||
uint16_t flash_size;
|
||||
uint32_t flash_size;
|
||||
|
||||
stlink_read_mem32(sl, 0x1FFFF7E0, 4);
|
||||
flash_size = sl->q_buf[0] | (sl->q_buf[1] << 8);
|
||||
|
@ -121,7 +121,8 @@ static const char* const memory_map_template =
|
|||
" <memory type=\"rom\" start=\"0x1ffff800\" length=\"0x8\"/>" // option byte area
|
||||
"</memory-map>";
|
||||
|
||||
char* make_memory_map(const struct chip_params *params, uint16_t flash_size) {
|
||||
static char*
|
||||
make_memory_map(const struct chip_params *params, uint32_t flash_size) {
|
||||
/* This will be freed in serve() */
|
||||
char* map = malloc(4096);
|
||||
map[0] = '\0';
|
||||
|
|
Ładowanie…
Reference in New Issue