Skip to content

Commit eb95ae6

Browse files
committed
mp
1 parent d13c931 commit eb95ae6

File tree

6 files changed

+53
-50
lines changed

6 files changed

+53
-50
lines changed

scripts/hello.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Hello, world!")

src/eez/gui/app_context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,15 @@ void AppContext::showPage(int pageId) {
263263
}
264264

265265
void AppContext::showPageOnNextIter(int pageId, Page *page) {
266-
m_nextIterOperation = NEXT_ITER_OPERATION_SET;
267266
m_pageIdToSetOnNextIter = pageId;
268267
m_pageToSetOnNextIter = page;
268+
m_nextIterOperation = NEXT_ITER_OPERATION_SET;
269269
}
270270

271271
void AppContext::pushPageOnNextIter(int pageId, Page *page) {
272-
m_nextIterOperation = NEXT_ITER_OPERATION_PUSH;
273272
m_pageIdToSetOnNextIter = pageId;
274273
m_pageToSetOnNextIter = page;
274+
m_nextIterOperation = NEXT_ITER_OPERATION_PUSH;
275275
}
276276

277277
void AppContext::pushSelectFromEnumPage(const data::EnumItem *enumDefinition, uint16_t currentValue,

src/eez/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static const uint32_t FILE_MANAGER_MEMORY_SIZE = 256 * 1024;
5757
static uint8_t * const VRAM_SCREENSHOOT_JPEG_OUT_BUFFER = FILE_MANAGER_MEMORY + FILE_MANAGER_MEMORY_SIZE;
5858
static const uint32_t VRAM_SCREENSHOOT_JPEG_OUT_BUFFER_SIZE = 256 * 1024;
5959

60-
static uint8_t * const DEBUG_TRACE_LOG = FILE_MANAGER_MEMORY + FILE_MANAGER_MEMORY_SIZE;
60+
static uint8_t * const DEBUG_TRACE_LOG = VRAM_SCREENSHOOT_JPEG_OUT_BUFFER + VRAM_SCREENSHOOT_JPEG_OUT_BUFFER_SIZE;
6161
static const uint32_t DEBUG_TRACE_LOG_SIZE = 32 * 1024;
6262

6363
static uint8_t * const SCREENSHOOT_BUFFER_START_ADDRESS = DEBUG_TRACE_LOG + DEBUG_TRACE_LOG_SIZE;

src/eez/modules/bp3c/relays.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ void toggleBootloader(int slotIndex) {
211211
// GPIO_InitStruct.Alternate = GPIO_AF12_UART7;
212212
// HAL_GPIO_Init(UART_TX_DOUT1_GPIO_Port, &GPIO_InitStruct);
213213

214-
DebugTrace("start slave FSM");
214+
DebugTrace("start slave FSM\n");
215215

216216
int wasFlashStatus = -1;
217217
uint32_t startTick = HAL_GetTick();
218218
while (true) {
219219
flashSlaveFSM();
220220
if (flashStatus != wasFlashStatus) {
221-
DebugTrace("flash status: %d", flashStatus);
221+
DebugTrace("flash status: %d\n", flashStatus);
222222
wasFlashStatus = flashStatus;
223223
}
224224

@@ -228,7 +228,7 @@ void toggleBootloader(int slotIndex) {
228228
}
229229
}
230230

231-
DebugTrace("end slave FSM after 3 seconds");
231+
DebugTrace("end slave FSM after 3 seconds\n");
232232
} else {
233233
write(REG_OUTPUT_PORT, 0b10000000);
234234
delay(5);

src/eez/mp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ State g_state;
130130

131131
char *g_scriptPath = (char *)MP_BUFFER;
132132
static char *g_scriptSource = g_scriptPath + MAX_PATH_LENGTH + 1;
133-
static const size_t MAX_SCRIPT_SOURCE_AND_HEAP_SIZE = MP_BUFFER_SIZE - MAX_PATH_LENGTH + 1;
133+
static const size_t MAX_SCRIPT_LENGTH = 32 * 1024;
134134
static size_t g_scriptSourceLength;
135135

136136
////////////////////////////////////////////////////////////////////////////////
@@ -230,7 +230,7 @@ void oneIter() {
230230
// this version reinitialise MP every time
231231
volatile char dummy;
232232
mp_stack_set_top((void *)&dummy);
233-
gc_init(g_scriptSource + g_scriptSourceLength, MP_BUFFER + MP_BUFFER_SIZE - 32768 - 1024);
233+
gc_init(g_scriptSource + MAX_SCRIPT_LENGTH, MP_BUFFER + MP_BUFFER_SIZE - MAX_SCRIPT_LENGTH);
234234
mp_init();
235235

236236
nlr_buf_t nlr;
@@ -258,7 +258,7 @@ void oneIter() {
258258
volatile char dummy;
259259
g_initialized = true;
260260
mp_stack_set_top((void *)&dummy);
261-
gc_init(g_scriptSource + g_scriptSourceLength, MP_BUFFER + MP_BUFFER_SIZE - 32768 - 1024);
261+
gc_init(g_scriptSource + MAX_SCRIPT_LENGTH, MP_BUFFER + MP_BUFFER_SIZE - MAX_SCRIPT_LENGTH);
262262
mp_init();
263263
}
264264

@@ -305,7 +305,7 @@ void loadScript() {
305305
}
306306

307307
fileSize = file.size();
308-
if (fileSize > MAX_SCRIPT_SOURCE_AND_HEAP_SIZE) {
308+
if (fileSize > MAX_SCRIPT_LENGTH) {
309309
goto Error;
310310
}
311311

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<launchConfiguration type="com.atollic.hardwaredebug.launch.launchConfigurationType">
3-
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.cpu_core" value="Cortex-M" />
4-
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.device" value="STM32F769IG" />
5-
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.endian" value="little" />
6-
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.init_speed" value="4000" />
7-
<booleanAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_auto" value="true" />
8-
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_irpre" value="0" />
9-
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_pos" value="0" />
10-
<stringAttribute key="com.atollic.hardwaredebug.launch.analyzeCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers&#xD;&#xA;# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode&#xD;&#xA;monitor flash set_parallelism_mode 2&#xD;&#xA;&#xD;&#xA;# Load the program executable&#xD;&#xA;load&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;# Enable Debug connection in low power modes (DBGMCU-&gt;CR)&#xD;&#xA;set *0xE0042004 = (*0xE0042004) | 0x7&#xD;&#xA;# Start the executable&#xD;&#xA;continue" />
11-
<booleanAttribute key="com.atollic.hardwaredebug.launch.enable_swv" value="false" />
12-
<intAttribute key="com.atollic.hardwaredebug.launch.formatVersion" value="2" />
13-
<stringAttribute key="com.atollic.hardwaredebug.launch.ipAddress" value="localhost" />
14-
<stringAttribute key="com.atollic.hardwaredebug.launch.jtagDevice" value="ST-LINK" />
15-
<intAttribute key="com.atollic.hardwaredebug.launch.portNumber" value="61234" />
16-
<stringAttribute key="com.atollic.hardwaredebug.launch.remoteCommand" value="target extended-remote" />
17-
<stringAttribute key="com.atollic.hardwaredebug.launch.runCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers&#xD;&#xA;# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode&#xD;&#xA;monitor flash set_parallelism_mode 2&#xD;&#xA;&#xD;&#xA;# Load the program executable&#xD;&#xA;load&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;# Enable Debug connection in low power modes (DBGMCU-&gt;CR)&#xD;&#xA;set *0xE0042004 = (*0xE0042004) | 0x7&#xD;&#xA;# Set a breakpoint at main().&#xD;&#xA;tbreak main&#xD;&#xA;&#xD;&#xA;# Run to the breakpoint.&#xD;&#xA;continue" />
18-
<stringAttribute key="com.atollic.hardwaredebug.launch.serverParam" value="-p 61234 -l 1 -d" />
19-
<booleanAttribute key="com.atollic.hardwaredebug.launch.startServer" value="true" />
20-
<booleanAttribute key="com.atollic.hardwaredebug.launch.swd_mode" value="true" />
21-
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_port" value="61235" />
22-
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_div" value="120" />
23-
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_hclk" value="120000000" />
24-
<booleanAttribute key="com.atollic.hardwaredebug.launch.swv_wait_for_sync" value="true" />
25-
<booleanAttribute key="com.atollic.hardwaredebug.launch.useRemoteTarget" value="true" />
26-
<stringAttribute key="com.atollic.hardwaredebug.launch.verifyCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers&#xD;&#xA;# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode&#xD;&#xA;monitor flash set_parallelism_mode 2&#xD;&#xA;&#xD;&#xA;# Load the program executable&#xD;&#xA;load&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;# Enable Debug connection in low power modes (DBGMCU-&gt;CR)&#xD;&#xA;set *0xE0042004 = (*0xE0042004) | 0x7&#xD;&#xA;# The executable starts automatically" />
27-
<booleanAttribute key="com.atollic.hardwaredebug.stlink.enable_logging" value="false" />
28-
<stringAttribute key="com.atollic.hardwaredebug.stlink.log_file" value="C:/Users/Martin/Dropbox/Code/EEZ/modular-psu-firmware/src/third_party/stm32_truestudio/\Debug\st-link_gdbserver_log.txt" />
29-
<booleanAttribute key="com.atollic.hardwaredebug.stlink.verify_flash" value="false" />
30-
<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb" />
31-
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)" />
32-
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi" />
33-
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false" />
34-
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb" />
35-
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2" />
36-
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/bb3.elf" />
37-
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="bb3" />
38-
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="" />
3+
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.cpu_core" value="Cortex-M"/>
4+
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.device" value="STM32F769IG"/>
5+
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.endian" value="little"/>
6+
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.init_speed" value="4000"/>
7+
<booleanAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_auto" value="true"/>
8+
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_irpre" value="0"/>
9+
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_pos" value="0"/>
10+
<stringAttribute key="com.atollic.hardwaredebug.launch.analyzeCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers&#13;&#10;# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode&#13;&#10;monitor flash set_parallelism_mode 2&#13;&#10;&#13;&#10;# Load the program executable&#13;&#10;load&#9;&#9;&#13;&#10;&#13;&#10;# Enable Debug connection in low power modes (DBGMCU-&gt;CR)&#13;&#10;set *0xE0042004 = (*0xE0042004) | 0x7&#13;&#10;# Start the executable&#13;&#10;continue"/>
11+
<booleanAttribute key="com.atollic.hardwaredebug.launch.enable_swv" value="false"/>
12+
<intAttribute key="com.atollic.hardwaredebug.launch.formatVersion" value="2"/>
13+
<stringAttribute key="com.atollic.hardwaredebug.launch.ipAddress" value="localhost"/>
14+
<stringAttribute key="com.atollic.hardwaredebug.launch.jtagDevice" value="ST-LINK"/>
15+
<intAttribute key="com.atollic.hardwaredebug.launch.portNumber" value="61234"/>
16+
<stringAttribute key="com.atollic.hardwaredebug.launch.remoteCommand" value="target extended-remote"/>
17+
<stringAttribute key="com.atollic.hardwaredebug.launch.runCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers&#13;&#10;# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode&#13;&#10;monitor flash set_parallelism_mode 2&#13;&#10;&#13;&#10;# Load the program executable&#13;&#10;load&#9;&#9;&#13;&#10;&#13;&#10;# Enable Debug connection in low power modes (DBGMCU-&gt;CR)&#13;&#10;set *0xE0042004 = (*0xE0042004) | 0x7&#13;&#10;# Set a breakpoint at main().&#13;&#10;tbreak main&#13;&#10;&#13;&#10;# Run to the breakpoint.&#13;&#10;continue"/>
18+
<stringAttribute key="com.atollic.hardwaredebug.launch.serverParam" value="-p 61234 -l 1 -d"/>
19+
<booleanAttribute key="com.atollic.hardwaredebug.launch.startServer" value="true"/>
20+
<booleanAttribute key="com.atollic.hardwaredebug.launch.swd_mode" value="true"/>
21+
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_port" value="61235"/>
22+
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_div" value="120"/>
23+
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_hclk" value="120000000"/>
24+
<booleanAttribute key="com.atollic.hardwaredebug.launch.swv_wait_for_sync" value="true"/>
25+
<booleanAttribute key="com.atollic.hardwaredebug.launch.useRemoteTarget" value="true"/>
26+
<stringAttribute key="com.atollic.hardwaredebug.launch.verifyCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers&#13;&#10;# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode&#13;&#10;monitor flash set_parallelism_mode 2&#13;&#10;&#13;&#10;# Load the program executable&#13;&#10;load&#9;&#9;&#13;&#10;&#13;&#10;# Enable Debug connection in low power modes (DBGMCU-&gt;CR)&#13;&#10;set *0xE0042004 = (*0xE0042004) | 0x7&#13;&#10;# The executable starts automatically"/>
27+
<booleanAttribute key="com.atollic.hardwaredebug.stlink.enable_logging" value="false"/>
28+
<stringAttribute key="com.atollic.hardwaredebug.stlink.log_file" value="C:/Users/Martin/Dropbox/Code/EEZ/modular-psu-firmware/src/third_party/stm32_truestudio/\Debug\st-link_gdbserver_log.txt"/>
29+
<booleanAttribute key="com.atollic.hardwaredebug.stlink.verify_flash" value="false"/>
30+
<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb"/>
31+
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)"/>
32+
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
33+
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
34+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb"/>
35+
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
36+
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
37+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/bb3.elf"/>
38+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="bb3"/>
39+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
3940
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
40-
<listEntry value="/bb3" />
41+
<listEntry value="/bb3"/>
4142
</listAttribute>
4243
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
43-
<listEntry value="4" />
44+
<listEntry value="4"/>
4445
</listAttribute>
45-
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#xD;&#xA;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#xD;&#xA;" />
46+
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
47+
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
4648
</launchConfiguration>

0 commit comments

Comments
 (0)