Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picsimlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
picsimlab
Commits
c1e0f05e
Commit
c1e0f05e
authored
Aug 07, 2020
by
lcgamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chg: support to set debug port !minor
parent
ba2fe1d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
src/boards/board_qemu_stm32.cc
src/boards/board_qemu_stm32.cc
+26
-19
src/boards/board_ucsim.cc
src/boards/board_ucsim.cc
+1
-1
No files found.
src/boards/board_qemu_stm32.cc
View file @
c1e0f05e
...
...
@@ -29,6 +29,7 @@
void
setblock
(
int
sock_descriptor
);
void
setnblock
(
int
sock_descriptor
);
char
*
serial_list
(
void
);
#ifndef _WIN_
#include<sys/types.h>
...
...
@@ -68,7 +69,7 @@ board_qemu_stm32::MInit(const char * processor, const char * fname, float freq)
char
buff
[
100
];
int
n
;
char
fname_
[
300
];
char
cmd
[
5
00
];
char
cmd
[
6
00
];
#ifdef _WIN_
...
...
@@ -152,34 +153,41 @@ board_qemu_stm32::MInit(const char * processor, const char * fname, float freq)
//verify if qemu executable exists
#ifdef _WIN_
if
(
!
lxFileExists
(
Window1
.
GetSharePath
()
+
lxT
(
"/../qemu-stm32.exe"
)))
if
(
!
lxFileExists
(
Window1
.
GetSharePath
()
+
lxT
(
"/../qemu-stm32.exe"
)))
#else
if
((
!
lxFileExists
(
"/usr/bin/qemu-stm32"
))
&&
(
!
lxFileExists
(
"/usr/local/bin/qemu-stm32"
)))
if
((
!
lxFileExists
(
"/usr/bin/qemu-stm32"
))
&&
(
!
lxFileExists
(
"/usr/local/bin/qemu-stm32"
)))
#endif
{
Message
(
"qemu-stm32 not found!"
);
close
(
listenfd
);
return
-
1
;
}
char
*
resp
=
serial_list
();
//verify if serial port exists
if
(
strstr
(
resp
,
SERIALDEVICE
))
{
snprintf
(
cmd
,
599
,
"qemu-stm32 -M stm32-f103c8-picsimlab -serial %s -qmp tcp:localhost:2500,server,nowait -gdb tcp::%i -pflash
\"
%s
\"
"
,
SERIALDEVICE
,
Window1
.
Get_debug_port
(),
fname_
);
}
else
{
snprintf
(
cmd
,
599
,
"qemu-stm32 -M stm32-f103c8-picsimlab -qmp tcp:localhost:2500,server,nowait -gdb tcp::%i -pflash
\"
%s
\"
"
,
Window1
.
Get_debug_port
(),
fname_
);
}
#ifdef _WIN_
snprintf
(
cmd
,
499
,
"qemu-stm32 -M stm32-f103c8-picsimlab -qmp tcp:localhost:2500,server,nowait -pflash
\"
%s
\"
"
,
fname_
);
#else
snprintf
(
cmd
,
499
,
"qemu-stm32 -M stm32-f103c8-picsimlab -serial %s -qmp tcp:localhost:2500,server,nowait -pflash
\"
%s
\"
"
,
SERIALDEVICE
,
fname_
);
#endif
free
(
resp
);
printf
(
"%s
\n
"
,
(
const
char
*
)
cmd
);
#ifdef _WIN_
lxExecute
(
Window1
.
GetSharePath
()
+
lxT
(
"/../"
)
+
cmd
);
#else
lxExecute
(
cmd
,
lxEXEC_MAKE_GROUP_LEADER
);
lxExecute
(
cmd
,
lxEXEC_MAKE_GROUP_LEADER
);
#endif
clilen
=
sizeof
(
cli
);
if
(
(
sockfd
=
accept
(
listenfd
,
(
sockaddr
*
)
&
cli
,
&
clilen
))
<
0
)
...
...
@@ -247,8 +255,8 @@ board_qemu_stm32::MEnd(void)
Window1
.
menu1_File_SaveHex
.
SetEnable
(
1
);
Window1
.
filedialog1
.
SetFileName
(
lxT
(
"untitled.hex"
));
Window1
.
filedialog1
.
SetFilter
(
lxT
(
"Hex Files (*.hex)|*.hex;*.HEX"
));
//Wait for qemu shutdown
//Wait for qemu shutdown
#ifdef _WIN_
Sleep
(
1000
);
#else
...
...
@@ -286,8 +294,7 @@ board_qemu_stm32::CpuInitialized(void)
}
void
board_qemu_stm32
::
DebugLoop
(
void
)
{
}
board_qemu_stm32
::
DebugLoop
(
void
)
{
}
String
board_qemu_stm32
::
MGetPinName
(
int
pin
)
...
...
src/boards/board_ucsim.cc
View file @
c1e0f05e
...
...
@@ -91,7 +91,7 @@ board_ucsim::MInit(const char * processor, const char * fname, float freq)
sprintf
(
fbuff
,
"%i"
,
(
int
)
freq
);
int
ret
=
ucsim_init
(
processor
,
fbuff
,
fname
,
SERIALDEVICE
);
int
ret
=
ucsim_init
(
processor
,
fbuff
,
fname
,
SERIALDEVICE
,
Window1
.
Get_debug_port
()
);
return
ret
;
}
...
...
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