NCS QEMU Testing not exiting

I would like to automate some unit tests with NCS.  I tried running the native_posix qemu builds, however, this does not support the mac m1 architecture (maybe Linux only?).

qemu_x86 works, but it sits in an infinite loop.  I want to automate the tests to stop the production build on test errors.

1. Perhaps there is an exit command I can add for the the qemu_x86?  I see the posix_exit(ret); for the native_posix builds

2. Bablesim looks really interesting, but I think that is Linux only.

3. Perhaps I should be looking elsewhere for unit testing rather than qemu with NCS? Any suggestions? 

My other thought is to run these in a docker container, but I would rather not need to do this.

Thanks!

Parents
  • Here is the way to exit Qemu with a debug exit instruction

    Run qemu with 

    -device isa-debug-exit,iobase=0xf4,iosize=0x04

    qemu-system-x86_64 -nographic -serial mon:stdio -kernel build_qemu/zephyr/zephyr.elf -device isa-debug-exit,iobase=0xf4,iosize=0x04 

    Use this function to write to the exit iobase:

    void dbg_io_write_8(uint16_t port, uint8_t val)
    {
    	__asm__ volatile("outb %0, %1" :: "a" (val), "Nd" (port));
    }
    
    
    dbg_io_write_8(0xF4, 0x4);

Reply
  • Here is the way to exit Qemu with a debug exit instruction

    Run qemu with 

    -device isa-debug-exit,iobase=0xf4,iosize=0x04

    qemu-system-x86_64 -nographic -serial mon:stdio -kernel build_qemu/zephyr/zephyr.elf -device isa-debug-exit,iobase=0xf4,iosize=0x04 

    Use this function to write to the exit iobase:

    void dbg_io_write_8(uint16_t port, uint8_t val)
    {
    	__asm__ volatile("outb %0, %1" :: "a" (val), "Nd" (port));
    }
    
    
    dbg_io_write_8(0xF4, 0x4);

Children
No Data
Related