Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple VME FMC Carrier SVEC
Commits
0af64366
Commit
0af64366
authored
Mar 22, 2021
by
Juan David Gonzalez Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flasher: fix wrong size of flash
Reported-by:
Rene Geissler
<
R.Geissler@gsi.de
>
parent
2c744a27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
svec-flasher.c
software/tools/vme-flasher/svec-flasher.c
+4
-2
No files found.
software/tools/vme-flasher/svec-flasher.c
View file @
0af64366
...
@@ -237,6 +237,7 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_
...
@@ -237,6 +237,7 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_
int
ret
=
0
;
int
ret
=
0
;
int
sector_size
;
int
sector_size
;
int
*
sector_map
;
int
*
sector_map
;
int
sector_map_size
;
if
(
flash_id
==
ID_M25P128
)
if
(
flash_id
==
ID_M25P128
)
sector_size
=
FLASH_SECTOR_SIZE_M25P128
;
sector_size
=
FLASH_SECTOR_SIZE_M25P128
;
...
@@ -245,12 +246,13 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_
...
@@ -245,12 +246,13 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_
else
else
return
-
ENODEV
;
return
-
ENODEV
;
sector_map
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
FLASH_SIZE
/
sector_size
);
sector_size
=
sizeof
(
int
)
*
FLASH_SIZE
/
sector_size
;
sector_map
=
(
int
*
)
malloc
(
sector_map_size
);
if
(
sector_map
==
NULL
)
if
(
sector_map
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
memset
(
sector_map
,
0
,
s
izeof
(
sector_map
)
);
memset
(
sector_map
,
0
,
s
ector_size
);
const
uint8_t
*
p
=
data
;
const
uint8_t
*
p
=
data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment