Method and system for redirecting firmware loading address of ARM (Advanced RISC Machines) processor

CN121501341APending Publication Date: 2026-02-10SHANGHAI ANLOGIC INFOTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511560117.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-02-10

Smart Images

  • Figure CN121501341A_ABST
    Figure CN121501341A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware loading address redirection method and system of an ARM processor, and belongs to the technical field of processors. According to the method and the device, the default starting address of the ARM processor is redirected to the first jump address of the chip, so that the ARM processor can be directly redirected to the first jump address after accessing the default starting address, and first-level address redirection is realized; then the target firmware configured by the user is stored in the chip through the target firmware starting address configured by the user, so that the target firmware configured by the user can be stored in the chip by processing the accessible target firmware starting address by an ARM (Advanced RISC Machines); generating a PC jump instruction through the target firmware address starting address, and writing the PC jump instruction into the first jump address; according to the method, the ARM processor can jump to the target firmware starting address through the PC jump instruction, so that second-level address redirection is realized, the ARM processor can load the target firmware at the target firmware starting address configured by a user, and the usability of a chip is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of processor technology, and in particular relates to a firmware loading address redirection method and system for ARM processors. Background Technology

[0002] With the continuous development of chip technology, various chips are widely used in consumer electronics, industrial control, automotive electronics, and the Internet of Things. For example, System-on-a-Chip (SoC) has become the mainstream solution for devices such as smartphones, tablets, and smart cars; while Microcontroller Units (MCUs), with their low cost, low power consumption, and strong real-time performance, are widely used in embedded scenarios such as home appliance control, sensor nodes, and industrial motor drives. The core computing units of many chips, including SoCs and MCUs, rely on CPUs for instruction processing, and the performance and architecture design of the CPU directly determine the overall efficiency of the chip.

[0003] To ensure the stability of chips in complex application environments and their performance after leaving the factory, comprehensive and rigorous debugging must be performed before chip packaging and shipping. This debugging process requires the CPU inside the chip to load specific firmware programs. ARM processors, as processors supporting the Aarch32 instruction set, encompass various architectures and have become widely used CPUs in chips. However, when an ARM processor is configured for Aarch32 power-on, it can only load firmware using one of two default addresses restricted by ARM: 0x00000000 or 0xFFFF0000. This imposes a boot address limitation on SoCs / MCUs integrating this processor during debugging, hindering user program debugging and reducing chip usability. Therefore, there is an urgent need for a firmware loading address redirection method and system for ARM processors to address the shortcomings of existing technologies. Summary of the Invention

[0004] This invention aims to provide a firmware loading address redirection method and system for ARM processors to solve the above-mentioned technical problems. By redirecting the default boot address to a first jump address and writing a PC jump instruction generated based on the target firmware boot address to the first jump address, a two-level redirection jump is used to realize the use of any address configured by the user as the firmware loading address, thereby improving the usability of the chip.

[0005] To address the aforementioned technical problems, embodiments of the present invention provide a firmware loading address redirection method for ARM processors, applicable to chips including ARM processors, comprising: Obtain the default boot address of the ARM processor and the first jump address of the chip, and redirect the default boot address to the first jump address; Read the target firmware boot address and target firmware configured by the user, and store the target firmware into the chip based on the target firmware boot address; A PC jump instruction is generated based on the target firmware boot address, and the PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor; Based on the default boot address, the first jump address, and the PC jump instruction, the ARM processor is driven to jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

[0006] Understandably, compared to existing technologies, this invention redirects the default boot address of the ARM processor to the chip's first jump address, enabling the ARM processor to directly redirect to the first jump address after accessing the default boot address, thus achieving first-level address redirection. Next, it obtains the user-configured target firmware boot address and the target firmware, and stores the target firmware in the chip based on the target firmware boot address, achieving storage of the user-configured target firmware at a target firmware boot address accessible to the ARM processor within the chip. It then generates a PC jump instruction based on the target firmware boot address and writes the PC jump instruction to the first jump address. This allows the ARM processor to jump to the target firmware boot address after reading and parsing the PC jump instruction in the first jump address, achieving second-level address redirection. By combining first-level and second-level address redirection, the ARM processor can load the target firmware at the user-configured target firmware boot address, enabling the use of any user-configured address as the firmware loading address and improving the chip's usability.

[0007] As a preferred embodiment, obtaining the default boot address of the ARM processor and the first jump address of the chip, and redirecting the default boot address to the first jump address, includes: Obtain the default boot address of the ARM processor; Identify the accessible memory space of the chip, and determine the first jump address and the first jump address range of the chip based on a preset redirection address range; Starting from the default boot address and combining it with the redirection address range, the boot address range of the ARM processor is determined; Each address in the startup address range is sequentially mapped to each corresponding address in the first jump address range, so as to redirect the default startup address to the first jump address.

[0008] This preferred solution identifies the chip's accessible memory space and, in conjunction with a preset redirection address range, determines the chip's first jump address and first jump address range. This not only avoids address conflicts during the first-level redirection process but also limits the addresses that need to be redirected, preventing excessive address changes from causing wear and tear on the ARM processor or chip. Subsequently, by mapping each address in the boot address range, the default boot address is redirected to the first jump address, avoiding the risk of boot failure due to address range mismatch. This achieves the first-level address redirection, providing a foundation for the subsequent ARM processor to load the target firmware at the user-configured target firmware boot address. This allows the subsequent ARM processor to use any user-configured address as the firmware loading address, improving the chip's usability.

[0009] As a preferred embodiment, the step of reading the user-configured target firmware boot address and target firmware, and storing the target firmware into the chip based on the target firmware boot address, includes: Read the user-precompiled boot image configuration file, parse the boot image configuration file, and obtain the target firmware boot address configured by the user; Read the target firmware configured by the user and store the target firmware at the target firmware boot address of the chip.

[0010] This preferred solution reads and parses the user-precompiled boot image configuration file, which ensures that the user-defined target firmware boot address can be recognized by the chip, thereby ensuring the accuracy of the subsequent second-level redirection. The target firmware is stored in a target firmware boot address accessible to the ARM processor within the chip, enabling the ARM processor to load the target firmware at the target firmware boot address, thus improving the chip's usability.

[0011] As a preferred embodiment, the step of generating a PC jump instruction based on the target firmware boot address and writing the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor includes: According to the preset ARMLDR instruction encoding rules, the target firmware boot address is written to the address following the first jump address; Based on the preset ARMLDR instruction encoding rules and the address following the first jump address, a PC jump instruction is generated; The PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor.

[0012] This preferred solution uses the ARMLDR instruction encoding rule to write the target firmware boot address to the address following the first jump address, and then uses this to generate a PC jump instruction. Writing the PC jump instruction to the first jump address implements address jumping in the ARM processor architecture. This not only conforms to the instruction processing logic of the ARM processor but also avoids ARM processor anomalies caused by incorrect address writing of the target firmware boot address. It ensures that the second-level address redirection of the ARM processor can be executed stably and correctly, enabling the ARM processor to load the target firmware at the user-configured target firmware boot address. This allows for the use of any user-configured address as the firmware loading address, improving the chip's usability.

[0013] As a preferred embodiment, the step of driving the ARM processor to jump to the target firmware boot address based on the default boot address, the first jump address, and the PC jump instruction, thereby enabling the ARM processor to load the target firmware at the target firmware boot address, includes: After the ARM processor starts based on the default boot address, it is redirected to the first jump address; Based on the PC jump instruction in the first jump address, the ARM processor is instructed to read the target firmware boot address from the address following the first jump address and jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

[0014] This preferred solution achieves first-level address redirection by driving the ARM processor to boot from the default boot address and then redirecting it to the first jump address. Subsequently, through the PC jump instruction in the first jump address, the ARM processor reads the target firmware boot address from the next address after the first jump address and jumps to the target firmware boot address, thereby achieving second-level address redirection. This enables the ARM processor to load the target firmware at the user-configured target firmware boot address, allowing any user-configured address to be used as the firmware loading address, thus improving the chip's usability.

[0015] Accordingly, embodiments of the present invention provide a firmware loading address redirection system for ARM processors, applicable to chips including ARM processors, comprising: a first-level redirection module, a user firmware loading address data acquisition module, a second-level redirection module, and a firmware loading module; The first-level redirection module is used to obtain the default boot address of the ARM processor and the first jump address of the chip, and redirect the default boot address to the first jump address; The user firmware loading address data acquisition module is used to read the target firmware boot address and target firmware configured by the user, and store the target firmware into the chip based on the target firmware boot address; The secondary redirection module is used to generate a PC jump instruction based on the target firmware boot address and write the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor; The firmware loading module is used to drive the ARM processor to jump to the target firmware startup address based on the default startup address, the first jump address and the PC jump instruction, so that the ARM processor loads the target firmware at the target firmware startup address.

[0016] As a preferred embodiment, the primary redirection module includes: a primary redirection unit; The first-level redirection unit is used to obtain the default boot address of the ARM processor; Identify the accessible memory space of the chip, and determine the first jump address and the first jump address range of the chip based on a preset redirection address range; Starting from the default boot address and combining it with the redirection address range, the boot address range of the ARM processor is determined; Each address in the startup address range is sequentially mapped to each corresponding address in the first jump address range, so as to redirect the default startup address to the first jump address.

[0017] As a preferred embodiment, the user firmware loading address data acquisition module includes: a user firmware loading address data acquisition unit; The user firmware loading address data acquisition unit is used to read the user's pre-compiled boot image configuration file, parse the boot image configuration file, and obtain the target firmware boot address configured by the user. Read the target firmware configured by the user and store the target firmware at the target firmware boot address of the chip.

[0018] As a preferred embodiment, the secondary redirection module includes: a secondary redirection unit; The secondary redirection unit is used to write the target firmware boot address to the address following the first jump address according to the preset ARMLDR instruction encoding rules; Based on the preset ARMLDR instruction encoding rules and the address following the first jump address, a PC jump instruction is generated; The PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor.

[0019] As a preferred embodiment, the firmware loading module includes: a firmware loading unit; The firmware loading unit is used to drive the ARM processor to start based on the default boot address and then redirect it to the first jump address; Based on the PC jump instruction in the first jump address, the ARM processor is instructed to read the target firmware boot address from the address following the first jump address and jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

[0020] Understandably, compared to existing technologies, this system redirects the ARM processor's default boot address to the chip's first jump address, enabling the ARM processor to directly redirect to the first jump address after accessing the default boot address, thus achieving first-level address redirection. Next, it obtains the user-configured target firmware boot address and the target firmware itself, and stores the target firmware in the chip based on the target firmware boot address, achieving storage of the user-configured target firmware at a target firmware boot address accessible to the ARM processor within the chip. It then generates a PC jump instruction from the target firmware boot address and writes the PC jump instruction to the first jump address. This allows the ARM processor to jump to the target firmware boot address after reading and parsing the PC jump instruction in the first jump address, achieving second-level address redirection. By combining first-level and second-level address redirection, the ARM processor can load the target firmware at the user-configured target firmware boot address, enabling the use of any user-configured address as the firmware loading address and improving the chip's usability. Attached Figure Description

[0021] Figure 1 A flowchart illustrating the steps of a firmware loading address redirection method for an ARM processor provided in an embodiment of the present invention; Figure 2 This is a flowchart of a two-level address redirection process for an ARM processor provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of address transformation for ARM two-level address redirection provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the firmware loading address redirection system for an ARM processor provided in an embodiment of the present invention. Detailed Implementation

[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] Example 1 Please refer to Figure 1 , Figure 1 The flowchart of the firmware loading address redirection method for an ARM processor provided in the embodiments of the present invention includes steps S101 to S104.

[0024] Step S101: Obtain the default boot address of the ARM processor and the first jump address of the chip, and redirect the default boot address to the first jump address.

[0025] In this embodiment, obtaining the default boot address of the ARM processor and the first jump address of the chip, and redirecting the default boot address to the first jump address, includes: Obtain the default boot address of the ARM processor; Identify the accessible memory space of the chip, and determine the first jump address and the first jump address range of the chip based on a preset redirection address range; Starting from the default boot address and combining it with the redirection address range, the boot address range of the ARM processor is determined; Each address in the startup address range is sequentially mapped to each corresponding address in the first jump address range, so as to redirect the default startup address to the first jump address.

[0026] In one optional embodiment, the default boot address of the ARM processor is obtained, which is 0xFFFF0000 or 0x00000000; this default boot address is determined by the architecture of the ARM processor. Then, the accessible memory space of the chip is identified, including: on-chip memory (OCM), peripheral storage space, and peripheral register space. In this embodiment, it is set to on-chip memory. The redirection address range is set to an integer multiple of the CPU's cache line size, i.e., an integer multiple of 64 bytes. Further, the size of the redirection address range can be set according to actual needs; in this embodiment, it is set to the size of one CPU cache line, which can reduce address mapping while satisfying redirection requirements. Then, in the chip's accessible memory space, a 64-byte address range is identified as the first jump address range, and its first address is used as the first jump address. Then, each address within the redirection address range starting from the default boot address is sequentially mapped to each address corresponding to the first jump address range. Furthermore, assuming the default boot address is 0xFFFF0000 and the redirection range is 64 bytes, the boot address range is 0xFFFF0000~0xFFFF003F; the first jump address is set to 0x6103FFC0, and the first jump address range is 0x6103FFC0~0x6103FFFF; then, according to the address order, each address in the boot address range is mapped to each address in the first jump address range; the mapping between addresses can be implemented by writing a script file. Since there is already a relatively mature technology for this in the processor, this embodiment will not elaborate further.

[0027] This embodiment identifies the chip's accessible memory space and, in conjunction with a preset redirection address range, determines the chip's first jump address and first jump address range. This not only avoids address conflicts during the first-level redirection process but also limits the addresses that need to be redirected, preventing excessive address changes from causing wear and tear on the ARM processor or chip. Subsequently, by mapping each address in the boot address range, the default boot address is redirected to the first jump address, avoiding the risk of boot failure due to address range mismatch. This achieves the first-level address redirection, providing a foundation for the subsequent ARM processor to load the target firmware at the user-configured target firmware boot address. This allows the subsequent ARM processor to use any user-configured address as the firmware loading address, improving the chip's usability.

[0028] Step S102: Read the target firmware boot address and target firmware configured by the user, and store the target firmware in the chip based on the target firmware boot address.

[0029] In this embodiment, reading the user-configured target firmware boot address and target firmware, and storing the target firmware into the chip based on the target firmware boot address, includes: Read the user-precompiled boot image configuration file, parse the boot image configuration file, and obtain the target firmware boot address configured by the user; Read the target firmware configured by the user and store the target firmware at the target firmware boot address of the chip.

[0030] In one optional embodiment, the user configures a custom target firmware boot address in the compilation software (this target firmware boot address needs to be an accessible storage medium address of the ARM processor within the chip), generates a boot image configuration file, and stores the compiled target firmware in the chip's peripheral storage medium. After the chip powers on, the chip reads the user-precompiled boot image configuration file and the target firmware from the peripheral storage medium. Then, the chip's own hardware logic code or a dedicated chip boot microkernel implements the BootImage parsing function, thereby parsing the boot image configuration file to obtain the user-configured target firmware boot address. The chip then stores the target firmware at the chip's target firmware boot address, that is, stores the target firmware at an accessible storage medium address of the ARM processor within the chip.

[0031] This embodiment reads and parses the user-precompiled boot image configuration file, which ensures that the user-defined target firmware boot address can be recognized by the chip, thereby ensuring the accuracy of the subsequent second-level redirection. The target firmware is stored in a target firmware boot address accessible to the ARM processor within the chip, so that the ARM processor can load the target firmware at the target firmware boot address, improving the chip's usability.

[0032] Step S103: Generate a PC jump instruction based on the target firmware boot address, and write the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor.

[0033] In this embodiment, the step of generating a PC jump instruction based on the target firmware boot address and writing the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor includes: According to the preset ARMLDR instruction encoding rules, the target firmware boot address is written to the address following the first jump address; Based on the preset ARMLDR instruction encoding rules and the address following the first jump address, a PC jump instruction is generated; The PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor.

[0034] In one optional embodiment, the ARMLDR (AMRLoad Register) instruction encoding rule is a core instruction in the ARM architecture used to load data from memory into registers, belonging to the data transfer instruction category. Its instruction comprises a 32-bit word, following the following order: 31:28 bits: condition code, Cond; 27:25 bits: opcode 1, Op1; 24:21 bits: opcode 2, Op2; 20 bits: flags, S; 19:16 bits: base address register, Rn; 15:12 bits: destination register, Rd; 11:0 bits: offset, Offset. In CPU address retrieval, addresses are typically incremented by 4 or 8; this embodiment sets it to increment by 4. In one optional embodiment, based on the ARMLDR (AMRLoad Register) instruction encoding rules, assuming the first jump address is 0x6103FFC0, by incrementing the address by 4, the next address of the first jump address can be obtained as 0x6103FFC4; the target firmware boot address is defined as 0x61000000; then 0x61000000 is written to the next address of the first jump address, 0x6103FFC4; then, based on the ARMLDR (AMRLoad Register) instruction encoding rules, 0xE51FF004 written at the first jump address 0x6103FFC0 is encoded, resulting in the encoded instruction: LDR PC, [PC, #-4], that is, the PC jump instruction is LDR PC, [PC, #-4]. At this time, the PC jump instruction LDR PC, [PC, #-4] is written to the first jump address 0x6103FFC0; completing the redirection setting of the ARM processor; LDR PC, [PC, The function of #-4 is to read data from the address following the current instruction (incremented by 4) and write it to the PC to achieve a jump; PC refers to the Program Counter, which is the address used in the ARM processor to store the next instruction to be executed.

[0035] This embodiment uses the ARMLDR instruction encoding rule to write the target firmware boot address to the address following the first jump address, and then generates a PC jump instruction. Writing the PC jump instruction to the first jump address implements address jumping in the ARM processor architecture. This not only conforms to the instruction processing logic of the ARM processor but also avoids ARM processor anomalies caused by incorrect writing of the target firmware boot address. It ensures that the second-level address redirection of the ARM processor can be executed stably and correctly, enabling the ARM processor to load the target firmware at the user-configured target firmware boot address. This allows for the use of any user-configured address as the firmware loading address, improving the chip's usability.

[0036] Step S104: Based on the default boot address, the first jump address, and the PC jump instruction, drive the ARM processor to jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

[0037] In this embodiment, the step of driving the ARM processor to jump to the target firmware boot address based on the default boot address, the first jump address, and the PC jump instruction, thereby enabling the ARM processor to load the target firmware at the target firmware boot address, includes: After the ARM processor starts based on the default boot address, it is redirected to the first jump address; Based on the PC jump instruction in the first jump address, the ARM processor is instructed to read the target firmware boot address from the address following the first jump address and jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

[0038] In an optional embodiment, after the chip is powered on, the ARM processor will boot according to the default boot address, which in this embodiment is 0xFFFF0000. Since the default address 0xFFFF0000 has been redirected to 0x6103FFC0 in step S101, the ARM processor, after booting at the default address 0xFFFF0000, will be mapped to the chip's accessible memory space, namely the first jump address 0x6103FFC0 of the on-chip memory space. Then, the ARM processor executes the first instruction at the first jump address 0x6103FFC0 of the on-chip memory space, namely the PC jump instruction LDR PC, [PC, #-4], then reads the target firmware boot address 0x61000000 from the next address 0x6103FFC4 after the first address, and jumps to the corresponding target firmware boot address 0x61000000; then the ARM processor loads the user-configured target firmware at the target firmware boot address 0x61000000.

[0039] This embodiment achieves first-level address redirection by driving the ARM processor to boot from the default boot address and then redirecting it to the first jump address. Subsequently, the PC jump instruction in the first jump address causes the ARM processor to read the target firmware boot address from the next address after the first jump address and jump to the target firmware boot address, thereby achieving second-level address redirection. This enables the ARM processor to load the target firmware at the user-configured target firmware boot address, allowing any user-configured address to be used as the firmware loading address, thus improving the chip's usability.

[0040] In one alternative embodiment, please refer to Figure 2 and Figure 3 , Figure 2 This is a flowchart of a two-level address redirection process for an ARM processor provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of address translation for a two-level address redirection in ARM provided in an embodiment of the present invention; as shown below. Figure 2 and Figure 3As shown, peripheral storage space 2 (address range 0x100000000~0x1FFFFFFFF), peripheral storage space 1 (address range 0xFFFF0000~0xFFFFFFFF), and peripheral storage space 0 (address range 0x80000000~0xFFFEFFFF) are the chip's peripheral storage spaces; on-chip storage space 2 (address range 0x61040000~0x7FFFFFFF), on-chip storage space 1 (address range 0x20000000~0x60FFFFFF), and on-chip storage space 0 (address range 0x00000000~0x1FFFFFFF) are the chip's on-chip memory (OCM); and peripheral register space (address range 0x61000000~0x6103FFBF) is the chip's peripheral register space. Space); at the same time, the first-level redirection dedicated access address, that is, the first address jump address range of 0x6103FFC0~0x6103FFFF, is also the chip's on-chip storage space; The user configures the target firmware boot address in the compilation software and stores the compiled target firmware in the external storage medium. After the chip is powered on, the CPU starts up, reads the Boot Image configuration file and target firmware generated by the software in the external storage medium, parses the user-configured target firmware boot address (set to 0x61000000) stored in the Boot Image configuration file, and converts it into the corresponding PC jump instruction. At the same time, after the CPU starts up according to the default boot address, it performs the first level of address redirection, that is, redirects the default boot address to the first jump address 0x6103FFC0 in the on-chip memory space. Then, the ARM processor executes the first instruction, namely the PC jump instruction, at the first jump address 0x6103FFC0, jumps to the user-defined target firmware boot address, and implements the second level of address redirection. After two levels of address redirection, the CPU finally loads the target firmware according to the user-configured target firmware boot address.

[0041] This embodiment redirects the ARM processor's default boot address to the chip's first jump address, enabling the ARM processor to directly redirect to the first jump address after accessing the default boot address, thus achieving first-level address redirection. Next, it obtains the user-configured target firmware boot address and the target firmware itself, and stores the target firmware in the chip based on the target firmware boot address, achieving storage of the user-configured target firmware at a boot address accessible to the ARM processor within the chip. A PC jump instruction is generated from the target firmware boot address and written to the first jump address. This allows the ARM processor to jump to the target firmware boot address after reading and parsing the PC jump instruction in the first jump address, achieving second-level address redirection. By combining first-level and second-level address redirection, the ARM processor can load the target firmware at the user-configured target firmware boot address, enabling the use of any user-configured address as the firmware loading address and improving the chip's usability.

[0042] Example 2 Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of a firmware loading address redirection system for an ARM processor provided in an embodiment of the present invention. It is applicable to chips including ARM processors and includes: a first-level redirection module 201, a user firmware loading address data acquisition module 202, a second-level redirection module 203, and a firmware loading module 204. The first-level redirection module 201 is used to obtain the default boot address of the ARM processor and the first jump address of the chip, and redirect the default boot address to the first jump address; The user firmware loading address data acquisition module 202 is used to read the target firmware boot address and target firmware configured by the user, and store the target firmware into the chip based on the target firmware boot address; The secondary redirection module 203 is used to generate a PC jump instruction based on the target firmware boot address and write the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor; The firmware loading module 204 is used to drive the ARM processor to jump to the target firmware startup address based on the default startup address, the first jump address and the PC jump instruction, so that the ARM processor loads the target firmware at the target firmware startup address.

[0043] In this embodiment, the first-level redirection module 201 includes: a first-level redirection unit; The first-level redirection unit is used to obtain the default boot address of the ARM processor; Identify the accessible memory space of the chip, and determine the first jump address and the first jump address range of the chip based on a preset redirection address range; Starting from the default boot address and combining it with the redirection address range, the boot address range of the ARM processor is determined; Each address in the startup address range is sequentially mapped to each corresponding address in the first jump address range, so as to redirect the default startup address to the first jump address.

[0044] In this embodiment, the user firmware loading address data acquisition module 202 includes: a user firmware loading address data acquisition unit; The user firmware loading address data acquisition unit is used to read the user's pre-compiled boot image configuration file, parse the boot image configuration file, and obtain the target firmware boot address configured by the user. Read the target firmware configured by the user and store the target firmware at the target firmware boot address of the chip.

[0045] In this embodiment, the secondary redirection module 203 includes: a secondary redirection unit; The secondary redirection unit is used to write the target firmware boot address to the address following the first jump address according to the preset ARMLDR instruction encoding rules; Based on the preset ARMLDR instruction encoding rules and the address following the first jump address, a PC jump instruction is generated; The PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor.

[0046] In this embodiment, the firmware loading module 204 includes: a firmware loading unit; The firmware loading unit is used to drive the ARM processor to start based on the default boot address and then redirect it to the first jump address; Based on the PC jump instruction in the first jump address, the ARM processor is instructed to read the target firmware boot address from the address following the first jump address and jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

[0047] This embodiment redirects the ARM processor's default boot address to the chip's first jump address, enabling the ARM processor to directly redirect to the first jump address after accessing the default boot address, thus achieving first-level address redirection. Next, it obtains the user-configured target firmware boot address and the target firmware itself, and stores the target firmware in the chip based on the target firmware boot address, achieving storage of the user-configured target firmware at a boot address accessible to the ARM processor within the chip. A PC jump instruction is generated from the target firmware boot address and written to the first jump address. This allows the ARM processor to jump to the target firmware boot address after reading and parsing the PC jump instruction in the first jump address, achieving second-level address redirection. By combining first-level and second-level address redirection, the ARM processor can load the target firmware at the user-configured target firmware boot address, enabling the use of any user-configured address as the firmware loading address and improving the chip's usability.

[0048] In summary, this embodiment of the invention redirects the default boot address of the ARM processor to the first jump address of the chip, enabling the ARM processor to directly redirect to the first jump address after accessing the default boot address, thus achieving first-level address redirection. Then, it obtains the user-configured target firmware boot address and the target firmware, and stores the target firmware in the chip based on the target firmware boot address, achieving storage of the user-configured target firmware at a target firmware boot address accessible to the ARM processor within the chip. A PC jump instruction is generated from the target firmware boot address and written to the first jump address. This allows the ARM processor to jump to the target firmware boot address after reading and parsing the PC jump instruction in the first jump address, achieving second-level address redirection. By combining first-level and second-level address redirection, the ARM processor can load the target firmware at the user-configured target firmware boot address, enabling the use of any user-configured address as the firmware loading address and improving the chip's usability.

[0049] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A firmware load address redirection method for ARM processors, applicable to chips including ARM processors, characterized in that, include: Obtain the default boot address of the ARM processor and the first jump address of the chip, and redirect the default boot address to the first jump address; Read the target firmware boot address and target firmware configured by the user, and store the target firmware into the chip based on the target firmware boot address; A PC jump instruction is generated based on the target firmware boot address, and the PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor; Based on the default boot address, the first jump address, and the PC jump instruction, the ARM processor is driven to jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

2. The firmware loading address redirection method for an ARM processor as described in claim 1, characterized in that, The step of obtaining the default boot address of the ARM processor and the first jump address of the chip, and redirecting the default boot address to the first jump address, includes: Obtain the default boot address of the ARM processor; Identify the accessible memory space of the chip, and determine the first jump address and the first jump address range of the chip based on a preset redirection address range; Starting from the default boot address and combining it with the redirection address range, the boot address range of the ARM processor is determined; Each address in the startup address range is sequentially mapped to each corresponding address in the first jump address range, so as to redirect the default startup address to the first jump address.

3. The firmware loading address redirection method for an ARM processor as described in claim 1, characterized in that, The step of reading the user-configured target firmware boot address and target firmware, and storing the target firmware into the chip based on the target firmware boot address, includes: Read the user-precompiled boot image configuration file, parse the boot image configuration file, and obtain the target firmware boot address configured by the user; Read the target firmware configured by the user and store the target firmware at the target firmware boot address of the chip.

4. The firmware load address redirection method for an ARM processor as described in any one of claims 1 to 3, characterized in that, The step of generating a PC jump instruction based on the target firmware boot address and writing the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor includes: According to the preset ARMLDR instruction encoding rules, the target firmware boot address is written to the address following the first jump address; Based on the preset ARMLDR instruction encoding rules and the address following the first jump address, a PC jump instruction is generated; The PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor.

5. The firmware loading address redirection method for an ARM processor as described in claim 4, characterized in that, The step of driving the ARM processor to jump to the target firmware boot address based on the default boot address, the first jump address, and the PC jump instruction, thereby enabling the ARM processor to load the target firmware at the target firmware boot address, includes: After the ARM processor starts based on the default boot address, it is redirected to the first jump address; Based on the PC jump instruction in the first jump address, the ARM processor is instructed to read the target firmware boot address from the address following the first jump address and jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.

6. A firmware load address redirection system for ARM processors, applicable to chips including ARM processors, characterized in that, include: The module consists of a primary redirection module, a user firmware loading address data acquisition module, a secondary redirection module, and a firmware loading module. The first-level redirection module is used to obtain the default boot address of the ARM processor and the first jump address of the chip, and redirect the default boot address to the first jump address; The user firmware loading address data acquisition module is used to read the target firmware boot address and target firmware configured by the user, and store the target firmware into the chip based on the target firmware boot address; The secondary redirection module is used to generate a PC jump instruction based on the target firmware boot address and write the PC jump instruction into the first jump address to complete the redirection setting of the ARM processor; The firmware loading module is used to drive the ARM processor to jump to the target firmware startup address based on the default startup address, the first jump address and the PC jump instruction, so that the ARM processor loads the target firmware at the target firmware startup address.

7. The firmware load address redirection system for an ARM processor as described in claim 6, characterized in that, The primary redirection module includes: a primary redirection unit; The first-level redirection unit is used to obtain the default boot address of the ARM processor; Identify the accessible memory space of the chip, and determine the first jump address and the first jump address range of the chip based on a preset redirection address range; Starting from the default boot address and combining it with the redirection address range, the boot address range of the ARM processor is determined; Each address in the startup address range is sequentially mapped to each corresponding address in the first jump address range, so as to redirect the default startup address to the first jump address.

8. The firmware load address redirection system for an ARM processor as described in claim 6, characterized in that, The user firmware loading address data acquisition module includes: a user firmware loading address data acquisition unit; The user firmware loading address data acquisition unit is used to read the user's pre-compiled boot image configuration file, parse the boot image configuration file, and obtain the target firmware boot address configured by the user. Read the target firmware configured by the user and store the target firmware at the target firmware boot address of the chip.

9. The firmware load address redirection system for an ARM processor as described in any one of claims 6 to 8, characterized in that, The secondary redirection module includes: a secondary redirection unit; The secondary redirection unit is used to write the target firmware boot address to the address following the first jump address according to the preset ARMLDR instruction encoding rules; Based on the preset ARMLDR instruction encoding rules and the address following the first jump address, a PC jump instruction is generated; The PC jump instruction is written to the first jump address to complete the redirection setting of the ARM processor.

10. The firmware load address redirection system for an ARM processor as described in claim 6, characterized in that, The firmware loading module includes: a firmware loading unit; The firmware loading unit is used to drive the ARM processor to start based on the default boot address and then redirect it to the first jump address; Based on the PC jump instruction in the first jump address, the ARM processor is instructed to read the target firmware boot address from the address following the first jump address and jump to the target firmware boot address, thereby enabling the ARM processor to load the target firmware at the target firmware boot address.