-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First try to support new STM32L0x family. Tested on NUCLEO-L053R8 development board http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260001 Chid ID, read, erase and write flash works fine.
- Loading branch information
Jiří Netolický
committed
Aug 1, 2014
1 parent
ee68f19
commit 44c645b
Showing
2 changed files
with
181 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2010 by Spencer Oliver * | ||
* [email protected] * | ||
* * | ||
* Copyright (C) 2011 Øyvind Harboe * | ||
* [email protected] * | ||
* * | ||
* Copyright (C) 2011 Clement Burin des Roziers * | ||
* [email protected] * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | ||
***************************************************************************/ | ||
|
||
|
||
// Build : arm-eabi-gcc -c stm32lx.S | ||
.text | ||
.syntax unified | ||
.cpu cortex-m0plus | ||
.thumb | ||
.thumb_func | ||
.global write | ||
|
||
/* | ||
r0 - destination address | ||
r1 - source address | ||
r2 - count | ||
*/ | ||
|
||
// Set 0 to r3 | ||
movs r3, #0 | ||
// Go to compare | ||
b.n test_done | ||
|
||
write_word: | ||
// Load one word from address in r0, increment by 4 | ||
ldr r4, [r1] | ||
// Store the word to address in r1, increment by 4 | ||
str r4, [r0] | ||
// Increment r3 | ||
adds r3, #1 | ||
adds r1, #4 | ||
// does not matter, only first addr is important | ||
// next 15 bytes are in sequnce RM0367 page 66 | ||
adds r0, #4 | ||
|
||
test_done: | ||
// Compare r3 and r2 | ||
cmp r3, r2 | ||
// Loop if not zero | ||
bcc.n write_word | ||
|
||
// Set breakpoint to exit | ||
bkpt #0x00 |
Oops, something went wrong.