Hello
I want to design a boot application for my MCU RA6 controller.
I can generate project and build it correctly the boot project, but when i build the primary project it's built OK but then
when generates the signed file it cannot generate it and i have some error messages. These are the messages:
15:51:48 **** Boot Image Build of configuration Debug for project app_ra6m3_primary ****python "C:\\Proyectos\\MCUboot_Encrypted_Initial_Projects\\ra_mcuboot_ra6m3_swap_testmode/ra/fsp/src/rm_mcuboot_port/rm_mcuboot_port_sign.py" sign --header-size 0x200 --align 128 --max-align 128 --slot-size 0x20000 --max-sectors 4 --pad --pad-header app_ra6m3_primary.elf app_ra6m3_primary.bin.signed C:\Proyectos\MCUboot_Encrypted_Initial_Projects\ra_mcuboot_ra6m3_swap_testmode\ra\fsp\src\rm_mcuboot_port\rm_mcuboot_port_sign.py:19: DeprecationWarning: pkg_resources is deprecated as an API. See setuptools.pypa.io/.../pkg_resources.html import pkg_resourcesTraceback (most recent call last):ERROR: Required python packages are missing. Run the following command to install: File "C:\Proyectos\MCUboot_Encrypted_Initial_Projects\ra_mcuboot_ra6m3_swap_testmode\ra\fsp\src\rm_mcuboot_port\rm_mcuboot_port_sign.py", line 20, in <module>pip install -r ra/mcu-tools/MCUboot/scripts/requirements.txt pkg_resources.require(mcuboot_requirements) File "C:\Users\TL\.local\lib\python3.10-mingw_x86_64\site-packages\pkg_resources\__init__.py", line 968, in require needed = self.resolve(parse_requirements(requirements)) File "C:\Users\TL\.local\lib\python3.10-mingw_x86_64\site-packages\pkg_resources\__init__.py", line 829, in resolve dist = self._resolve_dist( File "C:\Users\TL\.local\lib\python3.10-mingw_x86_64\site-packages\pkg_resources\__init__.py", line 870, in _resolve_dist raise DistributionNotFound(req, requirers)pkg_resources.DistributionNotFound: The 'cbor2' distribution was not found and is required by the application15:51:49 Build finished
Can you please help me to resolve this problem? it seems that some python resources are outdated.
Thanks and best regards.
Luis Svensson
Hi Luis,
It seems that you have not installed some dependencies to be able to run successfully the necessary python scripts for this projects.
First of all make sure that you have installed Python make sure that the python version is 3.9.0 or later.
Type in the command prompt py --version to check which python version you have installed:
If you navigate the bootloader project you will that there is a txt called requirements.txt. This includes all the dependencies you need to install.
So you have to go to the bootloader project. Go to MCUboot folder of the project right click and select Command Prompt:
1. Make sure you have upgraded pip version by typing:
python -m pip install --upgrade pip
2. And then install the requirements by typing again in the command prompt:
pip3 install --user -r scripts/requirements.txt
This also described in this pdf document of the application note you got the sample code:
https://www.renesas.com/us/en/document/apn/ra6-secure-bootloader-using-mcuboot-and-internal-code-flash
Best Regards,
IK
Hi IK!
Thanks for your quick response.
I had done all the procedures as you said that are written in the application note, but the messages given by the IDE and compiler are always the same. I have Python 3.12 installed, and all the dependencies in the requirements file are satisfied. Can you give me some clues or solutions to this problem? Thanks in advance.
I had a similar issue and just commented out the cbor2 import as the signing script doesn't actually need to use the library to function, we use the script to sign our files when compiling a bootloader version.
Python CBOR library; cbor2 is deprecating Python 2.7 and 3.5 support : r/CBOR (reddit.com)