This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interpretation of the MPU-Default-Settings in HalCoGen

Other Parts Discussed in Thread: HALCOGEN

Hello

I did not find an interpretation of the MPU default settings in HalCoGen in any of the documents. So I started reverse engineering the pre-configured memory regions. The first memory regions are straight forward (RAM, Flash) but starting from Region 4 the intention of the already configured regions is not clear. I would appreciate a short explanation for each region. Thank you very much.

Best Regards,

Flurin

  • During the day I went trought the MPU default settings and found some more specific questions:

    Region 1:
    Region 1 is enabled, however all sub-regions are disabled. Does this disable the whole region in the same way as unchecking the "enable MPU region" would do?

    Region 3:
    Region 3 is mapped to the RAM. However, all sub-regions are disabled and no other region is mapped to the RAM. How come, that the processor runs? To my understanding, accesses to the RAM are illegal using this setting.

    Region 4:
    Same problem as in region 3.

    Region 11:
    Region 11 maps to the supervisor-stack. However the size is not the stack size configured in the RAM page of HalCoGen. What is the intention of this Region?

    Best Regards,

    Flurin Bühler

  • it is a week since I posted this, I really would appreciate any help. Thank you.

    Best regards,

    Flurin Bühler

  • Hello Flurin,

    We apologize for the delay. The point you are bringing is valid and I need to bring in the HalCoGen experts to understand further the intent of the default settings.

    I am targeting an answer early next week.

    Best regards,

    Luc

  • Hello Flurin,

    I would like to know if you enable the MPU in your code. The MPU Init code is in the file sys_mpu.asp and the name of the function to run is mpuInit. Is it enabled in your code?

    Looking at the different devices in HalCoGen it appears that region 3 and 4 have 8 disabled subregions for the RM devices and only the top 3 for some TMS570 devices. I am hinting toward a bug with HalCoGen, my understanding is that having a region divided in 8 disabled subregions means ignoring fully the region and going to the next priority level region for access rights.

    So to take your message back:

    Region 1:
    Region 1 is enabled, however all sub-regions are disabled. Does this disable the whole region in the same way as unchecking the "enable MPU region" would do?

    Region 3:
    Region 3 is mapped to the RAM. However, all sub-regions are disabled and no other region is mapped to the RAM. How come, that the processor runs? To my understanding, accesses to the RAM are illegal using this setting.

    Region 4:
    Same problem as in region 3.

    LB>> The processor runs because the MPU is not enabled. Enabling the MPU should cause a data background fault or at least the RAM data / instructions will not be located in an enabled region or subregion. I am still working with the HalCoGen team to fully confirm a bug for the RM devices.

    Best regards,

    Luc

  • Hello Luc

    Thank you for your answer. Yes, the MPU is enabled. The default-setting in HalCoGen is a tick at Enable and a tick at Enable background region and I call the _mpuInit_() function during the startup sequence.

    To verify i did the following tests:
    1: call _mpuInit_(); then read from RAM -> works
    2: call _mpuInit_();then _mpuEnable_();, then read from RAM -> works

    Therefore I assume, that the Setting for Region 3 is enabled, despite the disable sub-region-ticks are all set.

    Would you mind checking if this is a bug in HalCoGen?

    Best Regards,

    Flurin

  • Hello Flurin,

    This should be resolved with HalCoGen version 03.00.01

    Best regards,

    Luc