@@ -162,7 +162,8 @@ async function main() {
162162 config = await parseConfig ( configData , rootDir ) ;
163163
164164 firmwarePath = elf ?? join ( rootDir , config . wokwi . firmware ) ;
165- elfPath = elf ?? join ( rootDir , config . wokwi . elf ) ;
165+ const configElfPath = config . wokwi . elf ? join ( rootDir , config . wokwi . elf ) : undefined ;
166+ elfPath = elf ?? configElfPath ;
166167 } else if ( elf ) {
167168 firmwarePath = elf ;
168169 elfPath = elf ;
@@ -181,7 +182,7 @@ async function main() {
181182 process . exit ( 1 ) ;
182183 }
183184
184- if ( ! existsSync ( elfPath ) ) {
185+ if ( elfPath != null && ! existsSync ( elfPath ) ) {
185186 const fullPath = path . resolve ( elfPath ) ;
186187 console . error ( chalkTemplate `{red Error:} ELF file not found: {yellow ${ fullPath } }.` ) ;
187188 console . error (
@@ -268,7 +269,9 @@ async function main() {
268269 await client . connected ;
269270 await client . fileUpload ( 'diagram.json' , diagram ) ;
270271 const firmwareName = await uploadFirmware ( client , firmwarePath ) ;
271- await client . fileUpload ( 'firmware.elf' , readFileSync ( elfPath ) ) ;
272+ if ( elfPath != null ) {
273+ await client . fileUpload ( 'firmware.elf' , readFileSync ( elfPath ) ) ;
274+ }
272275
273276 for ( const chip of chips ) {
274277 await client . fileUpload ( `${ chip . name } .chip.json` , readFileSync ( chip . jsonPath , 'utf-8' ) ) ;
@@ -333,8 +336,8 @@ async function main() {
333336 } ;
334337
335338 await client . simStart ( {
336- elf : 'test.elf' ,
337339 firmware : firmwareName ,
340+ elf : elfPath != null ? 'firmware.elf' : undefined ,
338341 chips : chips . map ( ( chip ) => chip . name ) ,
339342 pause : timeToNextEvent >= 0 ,
340343 } ) ;
0 commit comments