<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>P-Series中的主题 Re: Issue enabling second core using custom boot (P2020)</title>
    <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1631835#M5124</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;After some debugging we have realized that the second core is now up and running.&lt;BR /&gt;We still cannot see what we had expected to see in the debugger, to us it still looks like core 1 is executing at 0xFFFFxxxx and that the code shown by the debugger at those addresses is not the code for our __secondary_spu function as described by my colleague earlier in this conversation.&lt;BR /&gt;However, by letting core 1 read-modify-write the value at an address in RAM while executing in the final eternal loop and continuously read that same address from core 0, we can see that the value is incremented.&lt;BR /&gt;This enough for us to continue our work. Thank you very much for your help.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2023 06:34:44 GMT</pubDate>
    <dc:creator>mariapalmqvist</dc:creator>
    <dc:date>2023-04-12T06:34:44Z</dc:date>
    <item>
      <title>Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1611704#M5109</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We have written a custom boot that setups and runs on core 0 on the P2020 processor. Our boot shall enable the second core and simply put it in an infinite loop but we are having problems getting it to run correctly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Setup&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The execution of core 0 is as follows:&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Core 0 is setup and configured. A LAW is setup for the complete RAM.&lt;/LI&gt;&lt;LI&gt;Defines a 4096 byte area at end of RAM (starting at 0x3FFFF000) to use as boot page for CPU 1, and copies the CPU 1 start up code to that area., see code below.&lt;/LI&gt;&lt;LI&gt;Updates the boot page translation register (Reset_BPTR)&lt;/LI&gt;&lt;UL&gt;&lt;LI&gt;Boot page translation is enabled by setting EN bit to 1&lt;/LI&gt;&lt;LI&gt;Translation address is set to the boot page start address shifted 12 bits.&lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;Write to register ECM_EEBPCR to set bit CPU1_EN to enable core 1&lt;/LI&gt;&lt;LI&gt;Currently core 0 then enters an infinite loop doing nothing.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The setup for core 1 performs initialisations in the&amp;nbsp;&lt;EM&gt;StartSecondaryCpu&lt;/EM&gt;&amp;nbsp;assembly function. For example a TLB entry, stack pointer and interrupt registers are setup. See attached code.&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The boot was programmed and the boot was executed normally. Thereafter, the programmed boot was debugged with CodeWarrior and the CodeWarrior TAP. Performing an attach it was possible to connect to both cores of the P2020 processor.&lt;/P&gt;&lt;P&gt;We have verified for Core 0 that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The Reset_BPTR register is set to: 0x8003ffff&lt;/LI&gt;&lt;LI&gt;Th ECM_EEBPCR register value goes from 0x01000000 to 0x03000000&lt;/LI&gt;&lt;LI&gt;The instructions for assembly function&amp;nbsp;&lt;EM&gt;StartSecondaryCpu&lt;/EM&gt;&amp;nbsp;was successfully copied to the BootPageAddress&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Continuing core 0 then runs into an infinite loop as intended.&lt;/P&gt;&lt;P&gt;When attaching to Core 1 and pausing, we see that it is stuck at instructions at 0xFFFFF114, from cleanup_glue() reent.c35 0x00000000, see attached image. This address 0xFFFFF114 is part of the default boot ROM which we do not want to exectue from.&amp;nbsp;&lt;STRONG&gt;Core 1 should be stuck in an infinite loop as part of the&amp;nbsp;&lt;EM&gt;StartSecondaryCpu&lt;/EM&gt;&amp;nbsp;assembly function but it is not.&lt;/STRONG&gt;&amp;nbsp;While core 1 is paused with the debugger the following was observed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Reading the memory for the core 1 stack pointer showed it had been initialized.&lt;/LI&gt;&lt;LI&gt;Looking at the TLB entry registers showed that it was setup as intended.&lt;/LI&gt;&lt;LI&gt;IVPR, IVOR registers updated correctly&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thus seemingly the setup code for core 1, in&amp;nbsp;&lt;EM&gt;StartSecondaryCpu&lt;/EM&gt;&amp;nbsp;assembly function, is being run.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Core1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/213751iE0A88C15547E5D21/image-size/large?v=v2&amp;amp;px=999" role="button" title="Core1.PNG" alt="Core1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Setup code running on core 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;#define SET_BIT_REG32(bit) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint32_t)(1UL &amp;lt;&amp;lt; (31UL - (bit)))&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;#define BPTR_BOOT_PAGE_SHIFT &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12U&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;#define Reset_BPTR_EN_BIT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0U&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;#define HwMemMap_Ccsr_ECM_EEBPCR &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((uint32_t) 0x000001010UL)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;#define ECM_EEBPCR_CPU1_EN_BIT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6U&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Calculate the boot start page address */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;uint32_t BootPageSize&amp;nbsp;&amp;nbsp;&amp;nbsp; = 4096;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;uint32_t BootPageStartAddress = 0x40000000; /* 0x40000000 */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;uint32_t BootPageAddress = BootPageStartAddress - BootPageSize;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Copy boot. */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;memcpy ((void *) BootPageAddress, &amp;amp;StartSecondaryCpu, BootPageSize);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Setup Reset_BPTR register&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp; - The boot page translation enable is set to 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp; - The translation for boot page is set to the BootPageAddress shifted 12&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;*/&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Data = ((uint32_t)BootPageAddress &amp;gt;&amp;gt; BPTR_BOOT_PAGE_SHIFT) | SET_BIT_REG32(Reset_BPTR_EN_BIT);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;HwMemMap_WriteCcsrReg (HwMemMap_Ccsr_Reset_BPTR, Data);&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Start core 1 by setting bit CPU1_EN in ECM_EEBPCR register */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;HwMemMap_ReadCcsrReg (HwMemMap_Ccsr_ECM_EEBPCR, &amp;amp;Data);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;HwMemMap_WriteCcsrReg (HwMemMap_Ccsr_ECM_EEBPCR, Data | (SET_BIT_REG32(ECM_EEBPCR_CPU1_EN_BIT)) );&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Code for core 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FUNC_START StartSecondaryCpu&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;.align&amp;nbsp; 12&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;__secondary_cpu:&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable MCHK and debug */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis r3, 0x0200&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori r3, r3, 0x1200&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtmsr r3&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Manage L1 Caches */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; li r3, 0x2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr 0x3F2,r3 /* invalidate d-cache */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr 0x3F3,r3 /* invalidate i-cache */&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Setup TLB */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, 0x1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* entry's index */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, r5, 0x0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp;&amp;nbsp;&amp;nbsp; MAS0, r5&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, 0xC000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* entry valid and protected */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, r5, 0x0a00&amp;nbsp;&amp;nbsp;&amp;nbsp; /* size (4^TSIZE KiB) */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp;&amp;nbsp;&amp;nbsp; MAS1, r5&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, 0x0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* effective page number */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, r5, 0x0008&amp;nbsp;&amp;nbsp;&amp;nbsp; /* write-through | cache inhibited | mem coherency | guarded | endianness */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp;&amp;nbsp;&amp;nbsp; MAS2, r5&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, 0x0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* real page number */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, r5, 0x003f&amp;nbsp;&amp;nbsp;&amp;nbsp; /* user permissions */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp;&amp;nbsp;&amp;nbsp; MAS3, r5&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tlbwe&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msync&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isync&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Setup stack */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r1, _stack_addr_cpu1@ha&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addi&amp;nbsp;&amp;nbsp;&amp;nbsp; r1, r1, _stack_addr_cpu1@l&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Prepare a terminating stack record. */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stwu&amp;nbsp;&amp;nbsp;&amp;nbsp; r1, -16(r1)&amp;nbsp; /* e500 required SP to always be 16-byte aligned */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0, 0x0000&amp;nbsp;&amp;nbsp; /* load up r0 with 0x00000000 */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0, 0(r1)&amp;nbsp;&amp;nbsp;&amp;nbsp; /* SysVr4 EABI Supp indicated that initial back chain word should be null */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0, -1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* load up r0 with 0xFFFFFFFF */&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0, 4(r1)&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Make an illegal return address of 0xFFFFFFFF */&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Interrupts */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r3, 0x3E00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 0x3E000000 16 MSB */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addi&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r3, r3, 0x0000 /* 0x3E000000 16 LSB */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp;&amp;nbsp;&amp;nbsp; IVPR, r3&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, 0x0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, 0x0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r5, 0x0100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp;&amp;nbsp; IVOR0, r4&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; … /* [repeating] */&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r4, r5, 0x1900&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtspr&amp;nbsp; IVOR35, r4&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/* Put the second cpu in an infinite loop */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;loop_inf:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b&amp;nbsp;&amp;nbsp; loop_inf&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Fill in the empty space.&amp;nbsp; The actual reset vector is the last word of the page */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;__secondary_cpu_end:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .space 4092 - (__secondary_cpu_end - __secondary_cpu)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;__secondary_reset_vector:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b&amp;nbsp;&amp;nbsp; __secondary_cpu&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;What are we missing in the setup for enabling core 1 and getting it to run correectly?&lt;/P&gt;&lt;P&gt;Thank you for your time!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 14:25:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1611704#M5109</guid>
      <dc:creator>edvinl</dc:creator>
      <dc:date>2023-03-08T14:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1616523#M5110</link>
      <description>&lt;P&gt;I escalated your case to the AE team, please refer to the following update from them.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I see customer can attach core1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can customer set break point at secondary core entry point "__secondary_cpu:", and stop here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If core1 can stop at "__secondary_cpu:", can customer debug step by step to check in which line cause core1 stunk?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 07:46:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1616523#M5110</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2023-03-16T07:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1617616#M5111</link>
      <description>&lt;P&gt;Hello, thanks for the reply,&lt;/P&gt;&lt;P&gt;We made several attempts to step through the code that shall execute on core 1 but we are running into issues getting debugging information from core 1.&lt;/P&gt;&lt;P&gt;In short the steps taken:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Set break points at the address of where the boot code is moved using the Debugger shell in CodeWarrior with command "bp 0x3ffffffc"&lt;/LI&gt;&lt;LI&gt;Perform a "Download" of our boot to RAM for core 0 and run to breakpoint right before the ECM_EEBPCR is set that enables core 1.&lt;/LI&gt;&lt;LI&gt;Perform an "Attach" to core 1.&lt;/LI&gt;&lt;LI&gt;Continue core 0 to kick core 1&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;What we see is that when we attach to core 1 it halts on 0xFFFFFFFC. Thus, we are unable to step through the code for&amp;nbsp; "__secondary_cpu" to see where it goes wrong.&lt;/P&gt;&lt;P&gt;Do you have any suggestions on how to debug core 1 in this case just after core 1 has been enabled to run.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 12:04:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1617616#M5111</guid>
      <dc:creator>edvinl</dc:creator>
      <dc:date>2023-03-17T12:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1619712#M5112</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Do you have any update on how to perform the debugging?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards, Edvin&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 10:26:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1619712#M5112</guid>
      <dc:creator>edvinl</dc:creator>
      <dc:date>2023-03-22T10:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1625695#M5115</link>
      <description>&lt;P&gt;Please refer to the following update from the AE team.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I compared your snapshot PNG and your code start from __secondary_cpu, seems they are different. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you ask customer double check the boot page code from 0x3ffff0000 is same as the 0xfffff000 from core1 view? &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Does customer perform flush cache after copy the bootpage code to 0x3ffff000?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 02:00:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1625695#M5115</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2023-03-31T02:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1626121#M5116</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Checking memory 0x3FFFF000 we see the code that was copied from&amp;nbsp;__secondary_cpu. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edvinl_5-1680270841762.png" style="width: 313px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/217337i5D08647846F936BA/image-dimensions/313x135?v=v2" width="313" height="135" role="button" title="edvinl_5-1680270841762.png" alt="edvinl_5-1680270841762.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;However, checking&amp;nbsp;0xfffff000 from&amp;nbsp;core 1 view in the debugger show what looks like the on-chip boot and not our&amp;nbsp;__secondary_cpu.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edvinl_0-1680270676584.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/217332iBDA998EE550DD004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edvinl_0-1680270676584.png" alt="edvinl_0-1680270676584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Do we expect them to be the same?&amp;nbsp; As stated in previous message, we are&amp;nbsp;unsure of how to set up the debugger in this case.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As for the caches we have them disabled during boot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 13:58:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1626121#M5116</guid>
      <dc:creator>edvinl</dc:creator>
      <dc:date>2023-03-31T13:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1627203#M5118</link>
      <description>&lt;P&gt;Please refer to the update from the AE team.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Q: Do we expect them to be the same? As stated in previous message, we are unsure of how to set up the debugger in this case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes. After enabled the boot page translation, the boot page space is mapping to the address that configured in BPTR. So they should be same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you not sure you get the correct state via codewarrior, I think you can configure the BPTR and access the boot page space from core0. If you cannot get he expected content in boot page space from core0, I think core1 cannot execute the instruction from the same address.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 02:04:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1627203#M5118</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2023-04-04T02:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issue enabling second core using custom boot (P2020)</title>
      <link>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1631835#M5124</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;After some debugging we have realized that the second core is now up and running.&lt;BR /&gt;We still cannot see what we had expected to see in the debugger, to us it still looks like core 1 is executing at 0xFFFFxxxx and that the code shown by the debugger at those addresses is not the code for our __secondary_spu function as described by my colleague earlier in this conversation.&lt;BR /&gt;However, by letting core 1 read-modify-write the value at an address in RAM while executing in the final eternal loop and continuously read that same address from core 0, we can see that the value is incremented.&lt;BR /&gt;This enough for us to continue our work. Thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 06:34:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Issue-enabling-second-core-using-custom-boot-P2020/m-p/1631835#M5124</guid>
      <dc:creator>mariapalmqvist</dc:creator>
      <dc:date>2023-04-12T06:34:44Z</dc:date>
    </item>
  </channel>
</rss>

