A device comprising: a NAND-flash memory comprising a read-only portion storing boot code and a key; and a system on a chip (SoC) , coupled to the NAND-flash memory, the SoC comprising: a read-only memory (ROM) storing one or more instructions; and a processor configured to: execute, upon startup, the one or more instructions stored in the ROM to request from the NAND-flash memory the boot code and the key; and load and execute the boot code to perform a chain of trust verification process on subsequent code during a booting process using the key, wherein the chain of trust verification process includes verifying a signature of the subsequent code based on the key from the NAND-flash memory; and if the chain of trust verification process returns an invalid signature, stop the booting process and execute instructions stored in the read-only portion of the NAND-flash memory to set the SoC in a recovery mode. a NAND-flash memory comprising a read-only portion storing boot code and a key; and a system on a chip (SoC) , coupled to the NAND-flash memory, the SoC comprising: a read-only memory (ROM) storing one or more instructions; and a processor configured to: execute, upon startup, the one or more instructions stored in the ROM to request from the NAND-flash memory the boot code and the key; and load and execute the boot code to perform a chain of trust verification process on subsequent code during a booting process using the key, wherein the chain of trust verification process includes verifying a signature of the subsequent code based on the key from the NAND-flash memory; and if the chain of trust verification process returns an invalid signature, stop the booting process and execute instructions stored in the read-only portion of the NAND-flash memory to set the SoC in a recovery mode. a read-only memory (ROM) storing one or more instructions; and a processor configured to: execute, upon startup, the one or more instructions stored in the ROM to request from the NAND-flash memory the boot code and the key; and load and execute the boot code to perform a chain of trust verification process on subsequent code during a booting process using the key, wherein the chain of trust verification process includes verifying a signature of the subsequent code based on the key from the NAND-flash memory; and if the chain of trust verification process returns an invalid signature, stop the booting process and execute instructions stored in the read-only portion of the NAND-flash memory to set the SoC in a recovery mode. execute, upon startup, the one or more instructions stored in the ROM to request from the NAND-flash memory the boot code and the key; and load and execute the boot code to perform a chain of trust verification process on subsequent code during a booting process using the key, wherein the chain of trust verification process includes verifying a signature of the subsequent code based on the key from the NAND-flash memory; and if the chain of trust verification process returns an invalid signature, stop the booting process and execute instructions stored in the read-only portion of the NAND-flash memory to set the SoC in a recovery mode. <EOS>