Arm Cortex-M Programming
"I wanted to learn the internals of Cortex-M architecture"

a mcu has two parts in it, the core (ARM) and the peripherals (vendor specific). To use a chip, you don't need to know the architectures of the core, but you need to have intimate knowledge of the peripherals.

if you want to know the architectures, Yiu's books on the whole CMx family are a great starting point. Be warned: it provide next to nothing to a practitioner.

otherwise, start with the datasheets, tool chain manuals and lots of coding.

As to vendor libraries, I use them often but only through a middle layer of mine so if I want to, I can easily swap out the vendor library in whole or in pieces with no change to my own user code. essentially, my user code has no knowledge about how a certain function is implemented.